bpj-gradle-plugin enables one-argument BPJ calls in Gradle projects by rewriting source code before Java compilation.
For end-to-end activation steps (including IDE behavior), see:
docs/PLUGIN_ACTIVATION_GUIDE.md
io.github.oriontheprogrammer.bpj
settings.gradle:
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}build.gradle:
plugins {
id "java"
id "io.github.oriontheprogrammer.bpj" version "0.3.1"
}
repositories {
mavenCentral()
}
dependencies {
implementation "io.github.oriontheprogrammer:bpj:0.3.1"
}buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.github.oriontheprogrammer:bpj-gradle-plugin:0.3.1"
}
}
apply plugin: "java"
apply plugin: "io.github.oriontheprogrammer.bpj"
repositories {
mavenCentral()
}
dependencies {
implementation "io.github.oriontheprogrammer:bpj:0.3.1"
}Input:
BPJ.println("Welcome {user.name}");Generated for compilation:
BPJ.println("Welcome {user.name}", java.util.Map.of("user", user));The plugin processes Java source sets and compiles transformed sources from:
build/generated/sources/bpj/<sourceSetName>
Supported BPJ methods:
format,formatStrict,print,printlnformatHighlighted,printHighlighted,printlnHighlighted
Static compatibility:
BPJ.print("El error es: {e}", this)inside static context is rewritten to generated map context.
bpj {
failOnError = true
failOnUnresolved = false
verbose = false
writeReport = false
}Default: true
If true, transformation failures break the build.
Default: false
If true, placeholders with unresolved root variables fail fast.
Default: false
If true, logs transformed files and replacement counts.
Default: false
If true, writes reports at:
build/reports/bpj/bpj-transform-<sourceSetName>.txt
For each source set:
bpjPrepareformainbpjPrepare<SourceSetName>for others (for examplebpjPrepareTest)