Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

Joint compilation of Java/Scala in 6.1

$
0
0

In 6.1, we got a new feature to model compilation order for java/scala.
Can this feature also be used to model an interdependence from java to scala and vice versa (e.g. some java classes depend on scala and some scala classes depend on java)?

My guess is that it cannot be used, but still wanted to inquire (might be worth mentioning in user guide).

I’m currently using the sourcesets to model that

    val sourceSets = the<SourceSetContainer>()
sourceSets {
    named("main") {
        withConvention(ScalaSourceSet::class) {
            scala {
                setSrcDirs(listOf("src/main/scala", "src/main/java"))
            }
        }
        java {
            setSrcDirs(emptyList<String>())
        }
    }

    named("test") {
        withConvention(ScalaSourceSet::class) {
            scala {
                setSrcDirs(listOf("src/test/scala", "src/test/java"))
            }
        }
        java {
            setSrcDirs(emptyList<String>())
        }
    }
}

Viewing all articles
Browse latest Browse all 19888

Trending Articles