https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

jw

04/01/2020, 6:52 PM
can i add custom java source dirs for a
jvm { withJava() }
target?
s

spierce7

04/01/2020, 7:36 PM
Have you tried adding src dirs through the source sets? I was able to successfully add source directories to the common source set like this, but I had to go through some trial and error, and many of the syntaxes that look like they will work didn’t, especially for kotlin-script-gradle. https://github.com/ScottPierce/kotlin-html/blob/master/kotlin-html-writer/build.gradle.kts#L22-L23
j

jw

04/01/2020, 8:03 PM
That's precisely what I'm doing now except in
jvmTest
. I've verified the
file
created has a correct final path but its sources are not being included in Java compilation.
s

spierce7

04/02/2020, 4:44 AM
Are you using the exact method / syntax I use in that example? The reason I ask is because again, there are other source adding syntaxes / functions that compile and look like they will work in kotlin-script-gradle, but don’t actually work.
l

Liliia

04/02/2020, 11:43 AM
s

spierce7

04/02/2020, 12:42 PM
@jw yeah, that's the syntax I was using in kotlin that didn't work. Stop using the += syntax and use my function call.
It should work for you when you move to my exact function call
3 Views