I want to define a Gradle Plugin inside my `build-...
# compose
k
I want to define a Gradle Plugin inside my
build-logic
that applies the Jetbrains Compose libraries. But trying it this way results in an error. There is no
KotlinMultiplatformExtension#compose
property available.
Copy code
class KmpComposePlugin : Plugin<Project> {
    override fun apply(target: Project) {
        with(target) {
            with(pluginManager) {
                apply("kmp")
                apply("org.jetbrains.compose")
            }

            val extension = extensions.getByType<KotlinMultiplatformExtension>()
            with(extension) {
                jvm()

                sourceSets.commonMain.dependencies {
                    implementation(this@with.compose.runtime)
                }
            }
        }
    }
}
p
You can ask also in the #gradle channel.
👍 1
👍🏽 1