Hello! What I should return from KotlinGradleSubpl...
# compiler
p
Hello! What I should return from KotlinGradleSubplugin.getPluginArtifact if I implement kotlin compiler plugin in buildSrc gradle section?
t
You need return artifact with Kotlin Compiler plugin inside (not Gradle plugin)
In best case Gradle plugin and Kotlin Compiler plugin - 2 separate artifacts
For example Gradle & Maven plugins can use single Kotlin Compiler plugin
p
I understand that. But I don't have artifact. I want to implement kotlin compiler plugin in buildSrc gradle project section. And use it for compiling modules in the same gradle project
s
You can publish artifact locally from buildSrc folder or use freeArgs of compiler to specify jar file built in the buildSrc 🙂
p
Thanks! It is good idea to provide gradle build classpath to kotlin compiler. Need to check possibility...
@shikasd I followed your suggestion and found more elegant solution:
Copy code
plugins.withType<KotlinMultiplatformPluginWrapper> {

        project.dependencies {
            add(org.jetbrains.kotlin.gradle.plugin.PLUGIN_CLASSPATH_CONFIGURATION_NAME, files(File(rootDir, "buildSrc/build/libs/buildSrc.jar")))
        }
}
And it works!
s
Huh, amazing! :)
You can check arrow meta gradle config as well, they just add a compiler jar without using JB gradle plugin