Overview
Kayan is a small, opinionated Kotlin Gradle plugin for layered JSON and YAML config. It works with Kotlin Multiplatform, JVM, and Android projects.
Kayan generates a typed Kotlin API so your code can read configuration directly instead of routing values through platform-specific build config.
Kayan is designed for non-sensitive configuration. If a value should stay out of generated code or normal Gradle configuration, keep it out of Kayan. See Security for the trust model and main boundaries.
How it works
Section titled “How it works”- You write JSON or YAML config files with a
flavorsobject for environment-specific values - You declare a schema in your
build.gradle.ktsusing thekayan {}DSL - Kayan merges base config with optional overrides and validates everything at build time
- A typed Kotlin object is generated that your shared code can import directly
Merge priority
Section titled “Merge priority”For a selected flavor, values resolve in this priority order:
- Custom config flavor value
- Custom config top-level default value
- Base config flavor value
- Base config top-level default value
Deterministic precedence. Strict schema validation. Generated Kotlin source.