Improve git version naming [2]
This commit is contained in:
parent
76169cc912
commit
c3e1300cd1
@ -29,17 +29,24 @@ configurations {
|
|||||||
data class GitInfo(val version: String, val count: String, val tag: String) {
|
data class GitInfo(val version: String, val count: String, val tag: String) {
|
||||||
// val tagIsVersion: Boolean get() = tag != "" && tag.matches(Regex("v[0-9]+\\.[0-9]\\.[0-9]"))
|
// val tagIsVersion: Boolean get() = tag != "" && tag.matches(Regex("v[0-9]+\\.[0-9]\\.[0-9]"))
|
||||||
|
|
||||||
val mainVersion: String get() = if (tag != "") tag else mod_version
|
val publishVersion: String get() {
|
||||||
|
if (tag != "")
|
||||||
val jarName: String get() {
|
return mod_version
|
||||||
if (count != "") {
|
else
|
||||||
return "$mainVersion-SNAPSHOT-${version}_$count"
|
return "$mod_version-SNAPSHOT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val jarName: String get() {
|
||||||
|
if (tag != "")
|
||||||
|
return "$mod_version-$version"
|
||||||
|
|
||||||
|
// if (count != "")
|
||||||
|
// return "$mod_version-SNAPSHOT-${version}_$count"
|
||||||
|
|
||||||
if (version != "") {
|
if (version != "") {
|
||||||
return "$mainVersion-SNAPSHOT-$version"
|
return "$mod_version-SNAPSHOT-$version"
|
||||||
} else {
|
} else {
|
||||||
return "$mainVersion-SNAPSHOT"
|
return "$mod_version-SNAPSHOT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,9 +55,9 @@ data class GitInfo(val version: String, val count: String, val tag: String) {
|
|||||||
return mod_version
|
return mod_version
|
||||||
|
|
||||||
if (version != "") {
|
if (version != "") {
|
||||||
return "$mainVersion-SNAPSHOT-$version"
|
return "$mod_version-SNAPSHOT-$version"
|
||||||
} else {
|
} else {
|
||||||
return "$mainVersion-SNAPSHOT"
|
return "$mod_version-SNAPSHOT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -329,6 +336,8 @@ if (mavenUser != null && mavenPassword != null) {
|
|||||||
artifact(tasks["sourceJar"])
|
artifact(tasks["sourceJar"])
|
||||||
artifact(tasks["deobfJar"])
|
artifact(tasks["deobfJar"])
|
||||||
|
|
||||||
|
version = gitVersion.publishVersion
|
||||||
|
|
||||||
pom {
|
pom {
|
||||||
scm {
|
scm {
|
||||||
url.set("https://gitlab.com/DBotThePony/overdrive-that-matters.git")
|
url.set("https://gitlab.com/DBotThePony/overdrive-that-matters.git")
|
||||||
|
Loading…
Reference in New Issue
Block a user