mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-12 03:47:33 +00:00
35 lines
770 B
Groovy
35 lines
770 B
Groovy
/**
|
|
* Gradle Script for Version
|
|
* Format Version String
|
|
*/
|
|
|
|
boolean isRelease() {
|
|
String s = rootProject.ext.config.snapshot
|
|
return s == null || s == "" || s == "0"
|
|
}
|
|
|
|
boolean isSnapshot() {
|
|
return !isRelease()
|
|
}
|
|
|
|
String getBuildNum() {
|
|
if (System.getenv("CIRCLE_BUILD_NUM") != null)
|
|
return System.getenv("CIRCLE_BUILD_NUM")
|
|
return "00"
|
|
}
|
|
|
|
//Example: 14.10a-SNAPSHOT-33
|
|
String getCSLVersion() {
|
|
return rootProject.ext.config.version + rootProject.ext.config.dev_version +
|
|
(isRelease() ? '' : ('-SNAPSHOT-' + getBuildNum()))
|
|
}
|
|
|
|
//Example: 14.10a-s33
|
|
String getShortVersion() {
|
|
return getCSLVersion().replace("SNAPSHOT-", "s")
|
|
}
|
|
|
|
ext {
|
|
getCSLVersion = this.&getCSLVersion
|
|
getShortVersion = this.&getShortVersion
|
|
} |