https://kotlinlang.org logo
Title
c

Czar

08/22/2017, 8:01 AM
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:
// 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

tapchicoma

08/22/2017, 11:13 AM
What does
copyMainKotlinClasses
task? And why you need it?
c

Czar

08/22/2017, 11:29 AM
@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

tapchicoma

08/22/2017, 11:53 AM
I heard that there is some changes where kotlin now puts class files, may check it later
c

Czar

08/22/2017, 12:22 PM
I'll create an issue on YT, when I have the time. Because to me it looks like a regression.
t

tapchicoma

08/22/2017, 3:36 PM
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

Czar

08/23/2017, 8:05 AM
As I've said, without it Groovy code does not see Kotlin code. Depending on compileKotlin instead does not have any effect either.