Albert ten Napel
10/28/2025, 2:12 PMsource = fileTree("$projectDir").matching {
include("$javaSourceDirName/**/*.java")
excludedJavaFiles.forEach { exclude(it) }
}
This results in many errors such as:
Cannot infer source root(s) for source `file 'C:\...\Blabla.java'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.
This seems to disable incremental compilation. How can I fix this code snippet?Vampire
10/28/2025, 2:20 PMAlbert ten Napel
10/28/2025, 2:21 PM$projectDir) which contains Java source files (in nested directories). I also have a list of excluded Java files. I want to set the source of this "compile" task to the Java source files minus the excluded Java files.Vampire
10/28/2025, 2:22 PMAlbert ten Napel
10/28/2025, 2:29 PMVampire
10/28/2025, 2:43 PMVampire
10/28/2025, 2:44 PMVampire
10/28/2025, 2:46 PMtasks.compileJava {
exclude(...)
}