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.
Usage
Apply the plugin to your project.
plugins {
id("net.kyori.blossom") version "1.2.0"
}
Replacements can be configured through the BlossomExtension
.
Global Replacement (all files)
Replacing all instances of the string APPLE
(case-sensitive) with the string BANANA
, in all files.
blossom {
replaceToken("APPLE", "BANANA")
}
Local Replacement (per-file)
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)
}