BuildConfig Migration
Kayan works well as a gradual replacement for Android-only BuildConfig.
Migration steps
Section titled “Migration steps”- Inventory the constants that shared code actually reads
- Move shared values into
default.jsonordefault.yml - Move flavor-specific values into
flavors - Declare matching schema entries in
kayan { schema { ... } } - Keep generated property names aligned with existing constant names first
- Swap imports from
BuildConfigto the generated Kayan object
Before and after
Section titled “Before and after”// Beforeval baseUrl = BuildConfig.API_BASE_URL
// Afterimport sample.generated.SampleConfig
val baseUrl = SampleConfig.API_BASE_URLThe generated object lives in shared code, so every platform target can read it directly
without platform-specific expect/actual wiring.