How do I tell gradle/kotlin to include Java source...
# multiplatform
m
How do I tell gradle/kotlin to include Java sources for the
jvm()
sourceset? I tried adding
Copy code
val desktopMain by getting {
    kotlin.srcDirs(project.rootDir.resolve("src/desktopMain/java/"))
}
but that didn't seem to add anything when I published the release.
r
Declare your target as
jvm { withJava() }
☝️ 1
m
That causes an error since it's not compatible with the Android plugin apparently
Copy code
A problem occurred configuring root project 'multiplatfom-everything'.
> 'withJava()' is not compatible with Android Plugins
  Incompatible Android Plugin applied: 'com.android.library'
r
In that case, you'll have to put your Java code in a separate module
m
but then how do I publish it as part of this module?
r
Make the module with the Java code a dependency of your main module. I haven't done a setup like this in a while so I don't remember what you'll need in terms of glue code, but it should be possible.