I’m currently engaged in a multi-module project an...
# compose
r
I’m currently engaged in a multi-module project and dealing with stability concerns in the Compose UI. Would it be viable to introduce a dependency for the Compose runtime into a Java module that exclusively houses models?
z
Absolutely
🙏 1
r
I was trying to add it but it was not working. Are there any examples?
e
What wasnt working?
You should be adding a kotlin jvm module, adding the compose compiler plugin &. then adding the runtime as dependency (to get access to annotations), did you do al that and it still didnt work?
🙏 1
z
You don’t need the compiler plugin for models unless you’re doing something with the @Composable annotation
👍🏾 1
e
Good to know! I thought it used to generate a stable int into the class or so.
z
Oh true, if you want inference that’s a good point
👍🏾 1
r
plugins { id(“org.jetbrains.kotlin.jvm”) id(“org.jetbrains.kotlin.plugin.serialization”) id(“maven-publish”) } repositories { google() mavenCentral() } java { sourceCompatibility = JavaVersion._VERSION_1_8_ targetCompatibility = JavaVersion._VERSION_1_8_ } composeOptions { kotlinCompilerExtensionVersion = Versions.composeCompilerVersion } dependencies { _implementation_(Kotlin.jsonSerialization) _implementation_(Kotlin.coroutinesCore) _implementation_(Compose.composeRuntime) _testImplementation_(Kotlin.coroutinesTest) _testImplementation_(ArchComponents.extTesting) _testImplementation_(_project_(Modules.testUtils)) _testImplementation_(Testing.mockk) } publishing { publications { _create_<MavenPublication>(Maven.libwxacorePublicationName) { artifactId = “model” groupId = Maven.groupId version = Maven.libVersion from(_components_[“java”]) } } repositories { } }
This is my gradle file. I couldnt able to add compose option to it
Unresolved reference: composeOptions
const val composeCompilerVersion = “1.4.4” const val composeVersion = “1.4.0"