Benjamin Charais
06/02/2021, 8:03 PMjava-gradle-plugin
and I need it to have reference to some of the classes inside of the multiplatform
plugin.
I have the plugin working 100% if I use the kotlin("jvm")
plugin, but as soon as I switch to multiplatform
I get class implementation not found in the plugin, and unzipping the output jar in the gradle cache, has none of the java components, just meta data.
Is anyone aware of how I can override the publishing of the multiplatform targets (atleast one is required) so that it can use the plugin output rather than the multiplatform output? I Only need access to the classes from the multiplatform plugin, no outputs from it itself (or publishing for that matter)tapchicoma
06/02/2021, 8:08 PMcompileOnly
dependency for kotlin gradle plugin:
compileOnly(kotlin("gradle-plugin", <plugin_version>))
Benjamin Charais
06/02/2021, 8:12 PMimplementation(kotlin("gradle-plugin", version))
in a buildSrc, so I would need to re-add to classpath anyways?Benjamin Charais
06/02/2021, 8:13 PMtapchicoma
06/02/2021, 8:14 PMBenjamin Charais
06/02/2021, 8:16 PMorg.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
org.jetbrains.kotlin.gradle.dsl.plugin.mpp.Framework
org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask
Benjamin Charais
06/02/2021, 8:16 PMtapchicoma
06/02/2021, 8:19 PMcompileOnly
dependency into plugin module dependencies { .. }
block and wrap code that calls KMMGP classes with project.plugins.withId("org.jetbrains.kotlin.multiplatform") { // your code here }
.
Why compileOnly
? Then you plugin will not bring as a dependency specific version of Kotlin Gradle Plugin, but still will react if user will explicitly add it to the buildscript.Benjamin Charais
06/02/2021, 8:20 PM