Kite Config Build Config Extension
Generated Kotlin constants for your shared code, inside kiteConfig { buildConfig { ... } }.
kiteConfig {
appName = "Jetzy"
version = "1.4.0"
id = "com.example.jetzy"
modules { shared = ":shared" }
buildConfig {
packageName = "com.example.jetzy.generated"
stringField("BASE_URL", "https://api.acme.com")
intField("API_TIMEOUT_MS", 30_000)
booleanField("ANALYTICS_ENABLED", true)
}
}Opening this block turns generation on. KiteConfig writes one Kotlin object into the shared project's commonMain, so every platform reads the same constants without an expect and actual pair.
App identity rides along by default: app name, version, version code, Android application ID, iOS bundle ID, and locales. See includeIdentity to turn that off. Android SDK and toolchain values are never included; declare a custom field when runtime code needs one.
The generated file lives in a plugin-owned build directory and never enters your hand-written source tree. Package, object, and field names must be valid Kotlin names.
This is not a secret store. Only public client configuration belongs here. A provider can keep a value out of the build script and out of version control, but the resolved value still reaches generated source and Gradle task inputs. It can also surface in build scans, KLIBs, APKs, IPAs, decompiled binaries, and a trusted build cache when allowBuildCache is on. Never add passwords, private API keys, signing material, or other credentials.
Field helpers
| Helper | Generates |
|---|---|
stringField(name, value) | public const val name: String |
intField / longField / doubleField | the matching numeric const val |
booleanField(name, value) | public const val name: Boolean |
stringField(name, provider) | same, resolved lazily at task time |
Only stringField accepts a Provider. Give it a fallback: an absent provider fails the build naming the field, rather than emptying the whole set.
stringField("CHANNEL", providers.gradleProperty("channel").orElse("stable"))What generation requires
| Requirement | Why |
|---|---|
| a shared module | that is where commonMain lives |
| that module applies Kotlin Multiplatform | the object is generated into a KMP source set |
| complete identity, when includeIdentity is on | the object would otherwise emit half an identity |
See also
for selecting the module explicitly.
to generate fields only.
Properties
Whether Gradle may store the generated source in a build cache.
Whether KiteConfig app identity is baked into the object: app name, version, version code, the resolved Android and iOS IDs, and the canonical locales.
Kotlin package of the generated object, written as dot-separated identifiers such as com.acme.app.generated.
Functions
Add a validated Kotlin Boolean constant.
Add a validated finite Kotlin Double constant. NaN and infinite values are rejected.
Add a validated Kotlin String constant of at most 10,000 characters.
Add a validated Kotlin String constant from a provider.