Skip to content

Commit

Permalink
build: cleanup build script
Browse files Browse the repository at this point in the history
  • Loading branch information
darksaid98 committed May 29, 2024
1 parent 45880b3 commit 5ef6174
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,12 @@ tasks {
}
}

// Apply custom version arg
val versionArg = if (hasProperty("customVersion"))
(properties["customVersion"] as String).uppercase() // Uppercase version string
else
"${project.version}-SNAPSHOT-${Instant.now().epochSecond}" // Append snapshot to version

// Strip prefixed "v" from version tag
project.version = if (versionArg.first().equals('v', true))
versionArg.substring(1)
else
versionArg.uppercase()

publishing {
publications {
create<MavenPublication>("maven") {
groupId = "${project.group}"
groupId = "${rootProject.group}"
artifactId = "colorparser"
version = "${project.version}"
version = "${rootProject.version}"

pom {
name.set("ColorParser")
Expand Down Expand Up @@ -133,4 +121,16 @@ publishing {
}
}
}
}
}

// Apply custom version arg
val versionArg = if (hasProperty("customVersion"))
(properties["customVersion"] as String).uppercase() // Uppercase version string
else
"${project.version}-SNAPSHOT-${Instant.now().epochSecond}" // Append snapshot to version

// Strip prefixed "v" from version tag
project.version = if (versionArg.first().equals('v', true))
versionArg.substring(1)
else
versionArg.uppercase()

0 comments on commit 5ef6174

Please sign in to comment.