We've added compose related documentation: <https:...
# eap
t
We've added compose related documentation: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compiler.html JetBrains compose should be compatible starting
1.6.10-beta03
release.
K 7
thank you color 3
1
e
Why is jetbrains compose plugin still needed? 🤔 Figured, its for the compose dependencies thingy
c
I previously had a build-convention set up to apply config to all compose projects (e.g. compiler metrics). I’m having trouble identifying the right library to import into my build-convention build.gradle.kts so that I get access to the classes for configuration. This is what I have right now after bumping to Kotlin 2.0.0-rc2 and Compose Multiplatform 1.6.10-beta3 libs.versions.toml
Copy code
[versions]
compose = "1.6.10-beta03"
kotlin = "2.0.0-RC2"

[libraries]
compose-gradle = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose" }
compose-compiler = { module = "org.jetbrains.kotlin:kotlin-compose-compiler-plugin", version.ref = "kotlin" }
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
build-logic/build.gradle.kts
Copy code
dependencies {
    implementation(libs.compose.compiler)
    implementation(libs.compose.gradle)
    implementation(libs.kotlin.gradle)
}
build-logic-src/main/kotlin/compose-conventions.gradle.kts
Copy code
pluginManager.withPlugin("org.jetbrains.kotlin.plugin.compose") {
    extensions.configure<org.jetbrains.kotlin.gradle.compose.compiler.gradle.ComposeCompilerGradlePluginExtension>() {
         // Apply config...
    }
}
But the import for
org.jetbrains.kotlin.gradle.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
isn’t working. Is there something I’ve missed with this?
t
Should be
org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
c
With that change, the IDE is still not seeing the compose package.
image.png
e
For the plugin dependency, a “cheat code” to adding gradle plugins as dependencies (especially if you dont know the actual pligin jar) is usually group = $pluginID module = $pluginID.gradle.plugin version = $pluginVersion
t
compose-gradle = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "compose" }
should be
compose-gradle = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "compose" }
e
(or use the actual plugin jar that Yahor just supplied ☝🏾)
c
I think the package is
org.jetbrains.kotlin
instead of
org.jetbrains.compose
. It’ll take me a few minutes, several files need to be tweaked to get this working. I’ll report back shortly.
👌 1
Ok, I got it working with the edits we discussed above. Thanks for the help!
👍 1