KiteSsotBuildConfigExtension

Generates a Kotlin object with public runtime configuration.

Configure it inside kiteSsot { buildConfig { ... } }. KiteSSOT adds the generated object to the selected shared project's commonMain. Production source sets that depend on commonMain can read the same constants without expect and actual declarations.

By default, the object includes app name, version name, version code, Android application ID, iOS bundle ID, and locales. Set includeIdentity to false when you only want custom fields. Generated source stays in a plugin-owned build directory and never enters your hand-written source tree. Every package, object, and custom field name must be a valid Kotlin name.

Android SDK and toolchain values are not included automatically. If runtime code needs one, declare a custom field from the same root value that configures the Android block.

kiteSsot {
sharedProjectPath = ":shared"

buildConfig {
enabled = true
className = "BuildConfig" // default
packageName = "com.acme.app" // default: kitessot.generated

stringField("BASE_URL", "https://api.acme.com")
intField("API_TIMEOUT_MS", 30_000)
booleanField("ANALYTICS_ENABLED", true)
stringField(
"PUBLIC_CHANNEL",
providers.gradleProperty("publicChannel"),
)
}
}

This is not a secret store. Only put public client configuration here. A provider can keep a value out of the build script and version control, but the resolved value still enters generated source and Gradle task inputs. It may also appear in build scans, KLIBs, APKs, IPAs, decompiled binaries, and trusted build caches when allowBuildCache is enabled. Never add passwords, private API keys, signing material, or other credentials.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val allowBuildCache: Property<Boolean>

Whether Gradle may store the generated source in a build cache.

Link copied to clipboard
abstract val className: Property<String>

Valid Kotlin identifier for the generated object. The default is BuildConfig.

Link copied to clipboard
abstract val enabled: Property<Boolean>

Whether to generate the object. The default is false.

Link copied to clipboard
abstract val fields: ListProperty<String>

Legacy list representation for custom fields.

Link copied to clipboard
abstract val includeIdentity: Property<Boolean>

Whether to include KiteSSOT app identity in the generated object.

Link copied to clipboard
abstract val packageName: Property<String>

Valid Kotlin package for the generated object. The default is kitessot.generated.

Functions

Link copied to clipboard
fun booleanField(name: String, value: Boolean)

Add a validated Kotlin Boolean constant.

Link copied to clipboard
fun doubleField(name: String, value: Double)

Add a validated finite Kotlin Double constant. NaN and infinite values are rejected.

Link copied to clipboard
fun intField(name: String, value: Int)

Add a validated Kotlin Int constant. Int.MIN_VALUE is emitted as valid Kotlin source.

Link copied to clipboard
fun longField(name: String, value: Long)

Add a validated Kotlin Long constant. Long.MIN_VALUE is emitted as valid Kotlin source.

Link copied to clipboard
fun stringField(name: String, value: String)

Add a validated Kotlin String constant of at most 10,000 characters.

fun stringField(name: String, value: Provider<String>)

Add a validated Kotlin String constant from a provider.