Cleanup some version stuff in build.gradle.kts
This commit is contained in:
parent
5979956f48
commit
4c1a2ee227
1 changed files with 8 additions and 5 deletions
|
@ -104,15 +104,15 @@ tasks.shadowJar {
|
|||
}
|
||||
}
|
||||
|
||||
val isSnapshot = version.toString().endsWith("-SNAPSHOT")
|
||||
val isSnapshot = version().endsWith("-SNAPSHOT")
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register<MavenPublication>("shadow") {
|
||||
pluginConfig(project.version.toString())
|
||||
pluginConfig(version())
|
||||
}
|
||||
register<MavenPublication>("maven") {
|
||||
standardConfig(project.version.toString())
|
||||
standardConfig(version())
|
||||
}
|
||||
register<MavenPublication>("shadowLocal") {
|
||||
pluginConfig(localVersion())
|
||||
|
@ -217,10 +217,13 @@ fun MavenPom.pomConfig() {
|
|||
}
|
||||
}
|
||||
|
||||
fun version(): String {
|
||||
return project.version.toString()
|
||||
}
|
||||
fun localVersion(): String {
|
||||
return if (isSnapshot) {
|
||||
project.version.toString().substringBefore('-') + "-LOCAL-SNAPSHOT"
|
||||
version().substringBefore('-') + "-LOCAL-SNAPSHOT"
|
||||
} else {
|
||||
project.version.toString() + "-LOCAL"
|
||||
version() + "-LOCAL"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue