When including the Compose plugin in a multiplatfo...
# compose-desktop
t
When including the Compose plugin in a multiplatform module, is there a way to only apply it to the JVM targets? My module also contains native targets but I do not want the plugin to be applied to those, only jvm and Android. Is there a way to exclude the compiler for all the native targets?
I am currently trying to do something like this but not sure if this would work:
Copy code
configurations.all {
    exclude("org.jetbrains.compose.compiler", "compiler-hosted")
}
z
You could put your compose code in a separate module
t
Most of my compose code is in a separate module, but I need to use the Stable and Immutable annotations in common code so I thought expect/actual would be great for that. Basically I need a way to annotate common classes that are shared with iOS, too.
I am not sure how else to do that then just to include the compose dependencies in the same module
z
I don't think you should need the compiler for that in the module containing the models you want to annotate, just a dependency on the artifact containing the annotations.