NavEasePlugin
NavEase Gradle plugin — automatically wires KSP and the NavEase artifacts for Kotlin Multiplatform projects so users need zero manual boilerplate.
Before (manual setup — 15+ lines):
// shared/build.gradle.kts
plugins {
kotlin("multiplatform")
id("com.google.devtools.ksp")
}
kotlin {
sourceSets {
commonMain {
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
dependencies {
implementation("io.github.alims-repo:navease-runtime:<version>")
}
}
}
}
dependencies {
add("kspCommonMainMetadata", "io.github.alims-repo:navease-ksp:<version>")
}
tasks.withType<KotlinCompilationTask<*>>().configureEach {
if (name != "kspCommonMainKotlinMetadata") dependsOn("kspCommonMainKotlinMetadata")
}
tasks.configureEach {
if (name != "kspCommonMainKotlinMetadata" && name.startsWith("ksp")) {
dependsOn("kspCommonMainKotlinMetadata")
}
}Content copied to clipboard
After (with this plugin — 1 line):
plugins {
kotlin("multiplatform")
id("io.github.alims-repo.navease") version "<version>"
}
// Done — KSP, Kotlin Serialization, navease-runtime, navigation3-ui, and all KSP task
// wiring are handled automatically. Zero boilerplate — @Serializable just works.
//
// Note: navigation3-ui is auto-added to avoid compiler warnings about NavKey
// (NavEaseRoot's supertype) being inaccessible. If you already have navigation3-ui
// declared, auto-injection is skipped and Gradle uses your version.Content copied to clipboard
Handling Navigation3 Version Conflicts:
NavEase is smart about navigation3 dependencies:
If you already have
navigation3-uideclared, NavEase skips auto-injectionGradle's standard resolution applies (typically highest version wins)
You can force a specific version using
forceNavigation3Version = true
For local monorepo development, override dependencies via the navease {} extension:
navease {
kspProcessorDependency = project(":navease-ksp")
runtimeDependency = project(":navease-runtime")
// If you have version conflicts with navigation3:
navigation3Dependency = "org.jetbrains.androidx.navigation3:navigation3-ui:1.2.0"
forceNavigation3Version = true // Optional: force this version everywhere
// Or manage it yourself:
addNavigation3Dependency = false
}Content copied to clipboard