I want to exclude a directory in Gradle .. I'm using the code below .. When I do a minus
(i've also tried exclude
the directory that I'm trying to remove is still present in srcDirs
(when I output it at the end).
Suggestions ?
apply plugin: 'java'
sourceSets {
test {
java {
srcDirs 'src/test/unit/java'
minus 'src/test/java'
}
}
}
task outputDirs << { sourceSets.test.java.srcDirs.each{f -> println(f)}}
try this instead:
apply plugin: 'java'
sourceSets {
test {
java {
srcDirs = ['src/test/unit/java']
}
}
}
task outputDirs << { sourceSets.test.java.srcDirs.each{f -> println(f)}}
This reassigns the list of source directories (here only one) to the srcDirs property. using
srcDirs = 'src/test/unit/java'
as in your sample, just adds another source folder to the existing ones.
regards, René
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With