Repository navigation
0.13.0
Upgrading
If you have committed .stability baselines in a multi-module project, run ./gradlew stabilityDump once after upgrading and commit the result.
This release fixes a false positive where a module's own types were reported UNSTABLE whenever a sibling Gradle module's group happened to be a package prefix (common with allprojects { group = "com.example" }). The corrected verdicts move UNSTABLE -> STABLE, and with the default failOnStabilityChange = true / ignoreNonRegressiveChanges = false, stabilityCheck reports improvements too, so it will fail until the baseline is refreshed.
Single-module projects are unaffected.
Changed
-
Bumped Kotlin to 2.4.10 (from 2.4.0). Use the same Kotlin version as this library. The compiler plugin, runtime, Gradle plugin, Lint rules and IntelliJ plugin all build against 2.4.10, and every published target still compiles. No stability verdicts change: the Compose compiler's
analysis/Stability.ktis byte-identical between 2.4.0 and 2.4.10, and re-runningstabilityDumpon the sample app produced no diff, so committed.stabilitybaselines do not need refreshing for this bump alone.2.4.10's one Compose compiler fix, b/522127447 ("classes previously inferred
stablenow reportedruntime/Uncertain"), is inComposableFunctionBodyTransformer, not in stability inference. It restores the cast target type's stability when an argument is passed through aCAST/IMPLICIT_CAST, which affects the$changedmetadata Compose computes per call-site argument. This analyzer reports the stability of a parameter's declared type, so the fix is orthogonal to whatstabilityDumpand the IDE surface. -
allowIncrementalDisablingis now scoped per project. Previously a stability task anywhere in the build disabled Kotlin incremental compilation in every project applying the plugin. Each project now decides based on its own task paths../gradlew stabilityDump,stabilityCheckandcheckbehave identically; only a path-qualified invocation such as./gradlew :app:stabilityCheckdiffers, and there it is more correct — that task only reads:app's ownstability-info.json. -
The implicit
:stability-runtime/:stability-lintproject wiring is gone. The plugin used to callrootProject.findProject(...)and, when a module with either path existed, add thatProjectobject as a dependency notation. That only ever resolved inside this repository, silently hijacked any consumer build containing a module with those names, and is deprecated in Gradle 9 (an error in Gradle 10). The published Maven coordinates are now always used; lint checks continue to ship inside the runtime AAR'slint.jar. -
The compiler plugin's
projectDependenciesoption is deprecated and ignored. It stays registered so builds that pin the compiler artifact independently keep working, and will be removed in 1.0.
Fixed
- Gradle Isolated Projects compatibility (#107): the plugin no longer performs any cross-project access at configuration time, so builds using
--isolated-projects/org.gradle.isolated-projects=true(incubating since Gradle 9.7) configure and compile cleanly. Two violations are gone:collectProjectDependencies()walkedrootProject.allprojectsand read every sibling project'sgroup,projectDirandpath— including a filesystem scan of each sibling's sources — on every Kotlin compile-task configuration.- The incremental-compilation guard read
gradle.taskGraph.allTasks, which observes tasks created by other projects.
- Types declared in the module being compiled are no longer mis-reported as
UNSTABLE: cross-module detection used to match a parameter type's fully-qualified name against package prefixes guessed from sibling projects, and the first guess was the sibling's Gradlegroup. With the very commonallprojects { group = "com.example" }, that prefix also matched the module's owncom.example.*types, marking them unstable. Detection now relies solely on the IR declaration origin (IR_EXTERNAL_DECLARATION_STUB), which is the signal the Compose compiler itself uses and already covered every cross-module case. If you were affected, run./gradlew stabilityDumpto refresh your baseline — with the defaultfailOnStabilityChange = true,stabilityCheckwill otherwise fail on the resultingUNSTABLE → STABLEtransitions. - Cross-module types report an accurate reason: they were labelled
UNSTABLE (has mutable properties or unstable members)even when they had none. They now readUNSTABLE (cross-module type without @Stable/@Immutable). Reasons are not compared bystabilityCheck, so this alone cannot fail a build. - Stability verdicts no longer depend on compiler-plugin ordering:
@StabilityInferredis honoured only on declarations from outside the module being compiled, where it is baked into the binary and is the intended cross-module channel. On a class in the module being compiled it exists only after the Compose compiler plugin's IR lowering has run, and whether that happens before or after this plugin is decided by the resolved order ofkotlinCompilerPluginClasspath. The same source could therefore reportSTABLEin one build andRUNTIMEin another. Our own property analysis is authoritative for source classes, and ignoring the annotation there also matches the IDE plugin, which only ever sees source.
Note for contributors
The sample :app module now resolves the runtime from its published coordinate like any consumer, instead of from the in-build :stability-runtime project. Two consequences: ./gradlew :stability-runtime:publishToMavenLocal must run before :app picks up local runtime edits, and after a version bump :app cannot build until the new version is published to Maven Local.
That change also shifted where the analyzer's IR pass sits relative to the Compose compiler plugin's IR lowering — plugin order follows the resolved kotlinCompilerPluginClasspath order, and the in-build project dependency used to push the analyzer behind Compose. Consumers were always on the other side of that boundary, so nothing changes for them, but app/stability/*.stability was regenerated and now records what a real consumer sees: composable-lambda parameters render in their pre-lowering form (@[Composable] ComposableFunction0<T> rather than Function2<Composer, Int, T>), and Icon.normalSealedClass reports RUNTIME instead of STABLE because @StabilityInferred is not yet attached to same-module classes when the pass runs. The analysis no longer depends on that ordering — see the @StabilityInferred entry under Fixed — so the regenerated baseline is now stable regardless of how the plugin classpath resolves.