Configuration Reference
Top-Level Properties
Property | Type | Default | Description |
|---|---|---|---|
|
|
| Master switch — must be |
|
|
| Name of the generated Kotlin |
|
|
| Output path relative to the Gradle |
|
| (auto-derived) | Overrides the package of the generated file |
Package Name Resolution
The package name for the generated file is derived automatically from the Gradle project group and project name:
<projectGroup>.<projectName>.build
Both components are lowercased and spaces are removed. For example, a project with group = "com.example" and name = "MyLibrary" produces:
com.example.mylibrary.build
Override the package entirely with packageNameOverride:
When packageNameOverride is set, .build is appended to the value automatically:
com.example.internal.build
Registering Constants
Use the constant(key, value) function to register each constant. The key must not be blank, otherwise an IllegalArgumentException is thrown immediately.
Both overloads are available:
Overload | Description |
|---|---|
| Registers the value as-is |
| Calls |
Class Name and Output Path
Customize the generated class name and its location inside the build/ directory:
The file is then written to: build/generated/sources/<packagePath>/AppConfig.kt
Explicit API Mode
The generated class automatically respects the explicitApi setting from the platform extension. When explicit API mode is active, the generated object and all its const val properties receive a public modifier:
No additional configuration is required — this is wired automatically from platform { explicitApi }.