File tree Expand file tree Collapse file tree
stability-gradle/src/main/kotlin/com/skydoves/compose/stability/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,20 @@ public class StabilityAnalyzerGradlePlugin : KotlinCompilerPluginSupportPlugin {
7878 val stabilityDir = target.layout.buildDirectory.dir(" stability/$name " )
7979 outputs.dir(stabilityDir).optional(true )
8080 }
81+
82+ // Disable incremental compilation when stability tasks are in the graph (Issue #156)
83+ // Kotlin IC may skip recompiling files when dependency changes are binary-compatible,
84+ // but stability can still change (e.g., val → var makes a type UNSTABLE).
85+ target.gradle.taskGraph.whenReady {
86+ val hasStabilityTasks = allTasks.any {
87+ it is StabilityDumpTask || it is StabilityCheckTask
88+ }
89+ if (hasStabilityTasks) {
90+ target.tasks.withType(KotlinCompile ::class .java).configureEach {
91+ incremental = false
92+ }
93+ }
94+ }
8195 }
8296
8397 private fun registerTasksNonAndroid (target : Project , extension : StabilityAnalyzerExtension ) {
You can’t perform that action at this time.
0 commit comments