Is there any better way to access the `java` and `...
# gradle
s
Is there any better way to access the
java
and
kotlin
sourcesets (main & test) from gsk ?
Copy code
val compileJava: JavaCompile by tasks
compileJava.doFirst {
    java.sourceSets.asMap.forEach { name, srcSet ->
        val ktSrcSet = (srcSet as HasConvention).convention.getPlugin<KotlinSourceSet>()
        println("Java-${name.capitalize()} => ${srcSet.allSource.srcDirs.map { it.name }}")
        println("Kotlin-${name.capitalize()} => ${ktSrcSet.kotlin.srcDirs.map { it.name }}")
    }
}
m
i have not found a better way (same for
GroovySourceSet
)