stringField

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.

KiteConfig resolves the provider when it generates the source. This can keep the value out of the build script, but not out of generated source, task inputs, build scans, application binaries, or an enabled build cache. The resolved value may contain at most 10,000 characters. Do not use this for credentials.

The provider must have a value. A bare providers.gradleProperty("x") has none until someone passes -Px, and that fails the build naming this field. Give it a fallback when the value is optional:

stringField("CHANNEL", providers.gradleProperty("publicChannel").orElse("stable"))