I think I have a compile classpath issue that I ne...
# plugin-development
k
I think I have a compile classpath issue that I need some help with. Suppose I have this:
Copy code
src/
  main/
    groovy/
      my-groovy-plugin.gradle
    kotlin/
      my-kotlin-plugin.gradle.kts
wherein
my-kotlin-plugin
contains
Copy code
plugins {
  id("my-groovy-plugin")
}
Compilation is failing because of an
UnknownPluginException
in
my-kotlin-plugin
wrt the application of
my-groovy-plugin
. Any insights as to why this would be the case?
e
there is no groovy-kotlin joint compilation, and while there's ways to work around the ordering (if the dependencies only ever go one way) I'm not sure how that interacts with the plugin stuff…
you may have to
pluginManager.apply("my-groovy-plugin")
and forego any generated accessors, or move everything into a single language
k
My build is such that Groovy code compiles "first" - ie. Groovy code has no access to Kotlin code. That said, I am trying to investigate if the problem lies in arranging this setup.
I have it like this:
Copy code
tasks.compileGroovy {
  classpath = sourceSets["main"].compileClasspath
}

tasks.compileKotlin {
  libraries.from(sourceSets["main"].groovy.classesDirectory)
}
I'm suspecting that there is something amiss here.
e
I'm not sure how the plugin ids are processed but I am guessing you need to do some work to get those dependencies in the right order too