Class BamlPlugin
java.lang.Object
com.boundaryml.baml.gradle.BamlPlugin
- All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>
The BAML Gradle plugin (
com.boundaryml.baml) — pattern C of
ref-java-packaging.md: generate the typed BAML Java SDK at build time.
Applying the plugin:
- applies the
javaplugin (so the source sets exist); - registers the
baml { ... }extension; - registers the cacheable
GenerateBamlTaskgenerateBaml; - adds
generateBaml's output as a Java source root and itsbaml_sdk/**/*.b64bytecode as a resource, and makescompileJava/processResourcesdepend on it; - auto-manages the BAML runtime dependencies (the JavaFX-plugin pattern):
injects
com.boundaryml:baml-bridgeat the plugin's own version plus the native jar for the build machine, soplugins { id("com.boundaryml.baml") version "X" }is the entire setup. SeeBamlExtensionfor the opt-outs.
The generated tree lands under
build/generated/sources/baml/java/main and is (re)generated only when
baml.toml, baml_src/**, or the resolved CLI version change.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
BamlPlugin
public BamlPlugin()
-
-
Method Details
-
apply
public void apply(org.gradle.api.Project project) - Specified by:
applyin interfaceorg.gradle.api.Plugin<org.gradle.api.Project>
-