blossom is a Gradle plugin for performing source code token replacements in Java, Kotlin, Scala, and Groovy based projects. It is licensed under the LGPL v2.1 license.
Apply the plugin to your project.
plugins {
id("net.kyori.blossom") version "1.3.1"
}
Replacements can be configured through the BlossomExtension
.
Replacing all instances of the string APPLE
(case-sensitive) with the string BANANA
, in all files.
blossom {
replaceToken("APPLE", "BANANA")
}
Replacing all instances of the string APPLE
(case-sensitive) with the string BANANA
in the specified file(s).
blossom {
val constants = "src/main/java/org/example/application/Constants.java"
replaceToken("APPLE", "BANANA", constants)
}