This for discussion only. As I don’t have any issues to solve.
I work on a few projects, that require to have classes compiled to target specific version of Java.
Also, this is not about multi-release jar.
At this time I’ve seen these two approaches :
- the “language folder” is located under the “main source set” which seems fair given, the compiled classes will land in the same artifact.
val javaXMain by sourceSets.creating {
java {
srcDirs("src/main/java8")
}
}
- an additional “main source set”, with a java language folder
val javaXMain by sourceSets.creating {
java {
srcDir("src/javaXMain/java")
}
}
(Replace X by a java version, that is different form the main java version)
In both cases the source set methods are available and needed to wire things.
I don;t see any real drawback either way, but I’d like to discuss this as I may have missed some angle there.