Skip to content

Commit 2540b60

Browse files
committed
build: simplify capitalization
1 parent ce3943f commit 2540b60

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ task("release") {
174174

175175
val Project.isSnapshot get() = versionDetails.commitDistance != 0
176176
fun String.drop(prefix: String) = if (this.startsWith(prefix)) this.drop(prefix.length) else this
177-
fun String.capitalize() = this.replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }
178177

179178
val Project.versionDetails get() = (this.extra["versionDetails"] as groovy.lang.Closure<*>)() as com.palantir.gradle.gitversion.VersionDetails
180179
val ArtifactRepository.publishTask get() = tasks["publishAllPublicationsTo${this.name}Repository"]
181-
val NexusRepository.publishTask get() = "publishTo${this.name.capitalize()}"
180+
val NexusRepository.publishTask get() = "publishTo${this.name.replaceFirstChar { it.titlecase() }}"

0 commit comments

Comments
 (0)