/blossom

A Gradle plugin to perform source code token replacements in Java-based projects

Primary LanguageJavaGNU Lesser General Public License v2.1LGPL-2.1

blossom Build Status License Gradle Plugin

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.3.1"
}

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)
}