A Gradle plugin to generate build meta files for Kotlin (JVM / Multiplatform) and Java applications.
Documentation - Gradle Plugin Portal
- Type-safe build values (version, commit hash, ...) generated as constants
- Support for Java, Kotlin JVM, and Kotlin Multiplatform
- Multiple generated files, each with its own name, package, and naming strategy
- Placeholders to write the same values into resource files
- Custom type adapters for any value type
- Lazy
Providervalues, including git calls and task outputs - Configuration cache and isolated projects support
Requires Gradle 9.7 or newer, plus the Java, Kotlin JVM, or Kotlin Multiplatform plugin.
plugins {
id("dev.gradienttim.buildmeta") version "VERSION"
}See the installation guide for more details.
buildMeta {
main {
field("appName", "ExampleApp")
field("appVersion", "1.0.0")
}
}import com.example.generated.buildmeta.BuildMeta
fun main() {
println("${BuildMeta.appName} v${BuildMeta.appVersion}") // ExampleApp v1.0.0
}See the usage guide for field options, multiple BuildMetas, and values from git or environment variables. Types and Placeholders have their own pages.
Requires a JDK 17+.
git clone https://github.com/GradientTim/buildmeta.git
cd buildmeta
./gradlew buildThe samples directory contains example projects for Java, Kotlin JVM, and Kotlin Multiplatform.