I want to add a sourceset src/gen/java. With groovy this is rather easy and already described in https://discuss.gradle.org/t/how-to-use-gradle-with-generated-sourc
src/gen/java
Worked for me on Gradle 4.10.2:
sourceSets.getByName("main") { java.srcDir("src/main/java") java.srcDir("src/main/kotlin") } sourceSets.getByName("test") { java.srcDir("src/test/java") java.srcDir("src/test/kotlin") }
The codes above can also be used in subprojects block.
subprojects