This is not strictly Kdsl related, but in <#C0922A...
# gradle
c
This is not strictly Kdsl related, but in #general this wasn't answered, so maybe someone here can help? Sorry for double posting, but I did wait a while 🙂 After update to kotlin 1.1.4, my gradle build (groovy based) fails with following
Task with path 'copyMainKotlinClasses' not found in project
. In
build.gradle
I have:
Copy code
// groovy code should have access to kotlin classes for things like blablabla to work
tasks.compileGroovy.dependsOn 'copyMainKotlinClasses'
// and also for tests
tasks.compileTestGroovy.dependsOn 'copyTestKotlinClasses'
Gradle version: 4.0.1
t
What does
copyMainKotlinClasses
task? And why you need it?
c
@tapchicoma because the project I'm working on has Java, Groovy and Kotlin interlaced in the most peculiar way and without it Groovy classes cannot resolve Kotlin dependencies. This tasks ensures that Kotlin generated classes are available on the classpath before it compiles Groovy.
t
I heard that there is some changes where kotlin now puts class files, may check it later
checked, indeed there is no
copyMainKotlinClasses
task anymore, but I see compiled classes in
build/classes/kotlin
folder. Maybe you don't need this
dependsOn
anymore?
or depends on
compileKotlin
task
there was no check in 1.1.3
isSeparateClassesDirSupported
c
As I've said, without it Groovy code does not see Kotlin code. Depending on compileKotlin instead does not have any effect either.