Skip to content

Commit

Permalink
Replace normal occurences of the plugin name
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Sep 10, 2024
1 parent 35cc6f6 commit 368ddd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ fun capitalizeFirstLetter(string: String): String {
return string.first().uppercase() + string.drop(1)
}

fun titlecase(kebabcaseString: String): String {
return kebabcaseString.replace(kebabcaseStringSeparator, " ").split(" ").map { string -> capitalizeFirstLetter(string) }.joinToString(" ")
}

fun kebabcase(normalString: String): String {
return normalString.lowercase().replace(" ", kebabcaseStringSeparator)
}
Expand Down Expand Up @@ -151,6 +155,7 @@ tasks.register("renameProject") {
currentMainClassFilePath.renameTo(newMainClassFilePath)
}

replaceStringInDirectoryFiles(javaSourcePath.parentFile, newName, titlecase(projectNameString))
replaceStringInDirectoryFiles(javaSourcePath.parentFile, projectGroupString, newGroupString)
replaceStringInDirectoryFiles(javaSourcePath.parentFile, currentMainClassName, newMainClassName)

Expand Down

0 comments on commit 368ddd0

Please sign in to comment.