File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff 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
1315sourceCompatibility = JavaVersion . VERSION_1_8
1416targetCompatibility = 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}
You can’t perform that action at this time.
0 commit comments