Skip to content

Commit 251da75

Browse files
committed
Next build number test.
1 parent 5f5bba9 commit 251da75

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

build.gradle

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ plugins{
77
id 'com.github.johnrengelman.shadow' version '5.2.0'
88
}
99

10-
project.group = "com.andre601"
11-
project.version = "3.2.1"
10+
def ver = new Version(major: 3, minor: 2, revision: 1)
11+
12+
group = "com.andre601"
13+
version = "$ver"
1214

1315
sourceCompatibility = JavaVersion.VERSION_1_8
1416
targetCompatibility = JavaVersion.VERSION_1_8
@@ -76,6 +78,15 @@ publishing{
7678
}
7779
}
7880

79-
task shadowJar{
80-
version = version + "_" + System.getenv("BUILD_NUMBER")
81+
class Version{
82+
String major, minor, revision
83+
84+
static String getBuild(){
85+
System.getenv("BUILD_NUMBER") ?: System.getProperty("BUILD_NUMBER") ?:
86+
System.getenv("GIT_COMMIT")?.substring(0, 7) ?: System.getProperty("GIT_COMMIT")?.substring(0, 7) ?: "dev"
87+
}
88+
89+
String toString(){
90+
"$major.$minor.${revision}_$build"
91+
}
8192
}

0 commit comments

Comments
 (0)