I have the following in my build:
checkstyle {
sourceSets = [ subProject.sourceSets.main ]
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
showViolations = false
ignoreFailures = true
}
// exclude generated sources
checkstyleMain.exclude '**/generated-src/**'
// because cfg package is a mess mainly from annotation stuff
checkstyleMain.exclude '**/org/hibernate/cfg/**'
checkstyleMain.exclude '**/org/hibernate/cfg/*'
findbugs {
sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ]
ignoreFailures = true
}
// exclude generated sources
findbugsMain.exclude '**/generated-src/**'
In both of these cases the attempt to exclude generated sources has no effect. The other excludes work.
Why wont the ‘/generated-src/’ “ANT style exclude pattern” work? How can I tell these Gradle tasks to exlude generated sources? The generated sources are part of the indicated source sets, but in a separate directory (target/generated-src/**)?