I have a Multi Module KMP + CMP Project with a sep...
# compose
v
I have a Multi Module KMP + CMP Project with a separate Non-CMP module just for Data Models Now whats happening is that when I generate Compose Compiler Report, all my composable which take those models as parameter as shown as "Not Stable" The solution I know is to make that data models module a CMP Module, add
compose-runtime
and mark all data classes with
@immutable
, but I dont want to make my data layer modules a CMP Module Is there any other way of achieving it?
s
You can enable just the compose compiler on that module for it to apply the right stability to those classes Or read this https://fvilarino.medium.com/exploring-jetpack-compose-compilers-stability-config-f1ccb197d6c0 so that you can manually explain which classes are supposed to be considered stable with a text file. Go read at “Enabling the stability argument” and on
v
Thanks for this
I'm facing this error
Copy code
e: Unsupported plugin option: androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=/Users/vaibhav/Projects/Medial/MedialMultiplatform/shared/stability-config.txt
I'm on Compose Multiplatform 1.5.12 This is how my plugin args looks like
Copy code
kotlinOptions {
            // Trigger this with:
            // ./gradlew assembleRelease -PenableMultiModuleComposeReports=true --rerun-tasks
            if (project.findProperty("enableMultiModuleComposeReports") == "true") {
                freeCompilerArgs += listOf("-P", "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=$rootDir/shared/stability-config.txt")
                freeCompilerArgs += listOf("-P", "plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" + rootProject.buildDir.absolutePath + "/compose_metrics/")
                freeCompilerArgs += listOf("-P", "plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" + rootProject.buildDir.absolutePath + "/compose_metrics/")
            }
        }
s
I’ve never used it myself tbh, just pointed you to an article I’ve seen about it 🤷
v
No issues