mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
force version
This commit is contained in:
parent
59f8f2fdff
commit
84108b60c2
24
build.gradle
24
build.gradle
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user