force version

This commit is contained in:
dordsor21 2020-04-21 08:16:06 +01:00
parent 59f8f2fdff
commit 84108b60c2

View File

@ -1,5 +1,3 @@
import org.ajoberstar.grgit.Grgit
buildscript { buildscript {
repositories { repositories {
mavenCentral() mavenCentral()
@ -25,27 +23,7 @@ plugins {
group = "com.plotsquared" group = "com.plotsquared"
def rootVersion = "5" version = "5.10.0"
def revision = ""
def buildNumber = ""
def date = ""
ext {
git = Grgit.open(dir: new File(rootDir.toString() + "/.git"))
date = git.head().getDate().format("yy.MM.dd")
revision = "-${git.head().abbreviatedId}"
parents = git.head().parentIds
if (project.hasProperty("buildnumber")) {
buildNumber = "$buildnumber"
} else {
index = -2042 // Offset to match CI
for (; parents != null && !parents.isEmpty(); index++) {
parents = git.getResolve().toCommit(parents.get(0)).getParentIds()
}
buildNumber = "${index}"
}
}
version = String.format("%s.%s", rootVersion, buildNumber)
description = rootProject.name description = rootProject.name