sourceSets.main.java returns all java files that are supposed to be compiled by the java compiler. sourceSets.main.allJava also returns the java files that are located in the e.g. scala or groovy source directories and are normally compiled in joint compilation by the scala/groovy compiler.
Sounds reasonable, but in my project there are only java files. But by adding the ‘include’ i would expect to see only the matching files. Since both the ‘java’ and ‘allJava’ are both of type ‘SourceDirectorySet’
The ‘testTask’ (like in the first post) redefines the sourceSets by adding an include pattern and is then used in the second task which gives the expected result.
When i add an includes to a sourceSet i modify it, is there a way to select a subset of a sourceSet without modifying it?