HHH-9717 - Build script improvements - checkstyle and findbugs
This commit is contained in:
parent
9abb981ac2
commit
f0029d49bc
44
build.gradle
44
build.gradle
|
@ -228,29 +228,6 @@ subprojects { subProject ->
|
||||||
// Gradle plugin). For now, just compile first in order to get the logging classes.
|
// Gradle plugin). For now, just compile first in order to get the logging classes.
|
||||||
eclipseClasspath.dependsOn compile
|
eclipseClasspath.dependsOn compile
|
||||||
|
|
||||||
// specialized API/SPI checkstyle tasks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
task checkstylePublicSources(type: Checkstyle) {
|
|
||||||
checkstyleClasspath = checkstyleMain.checkstyleClasspath
|
|
||||||
classpath = checkstyleMain.classpath
|
|
||||||
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle.xml' )
|
|
||||||
source subProject.sourceSets.main.java.srcDirs
|
|
||||||
// exclude generated sources
|
|
||||||
exclude '**/generated-src/**'
|
|
||||||
// because cfg package is a mess mainly from annotation stuff
|
|
||||||
exclude '**/org/hibernate/cfg/**'
|
|
||||||
exclude '**/org/hibernate/cfg/*'
|
|
||||||
// because this should only report on api/spi
|
|
||||||
exclude '**/internal/**'
|
|
||||||
exclude '**/internal/*'
|
|
||||||
ignoreFailures = false
|
|
||||||
showViolations = true
|
|
||||||
reports {
|
|
||||||
xml {
|
|
||||||
destination "$buildDir/reports/checkstyle/public.xml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// Report configs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// Report configs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
checkstyle {
|
checkstyle {
|
||||||
|
@ -259,14 +236,8 @@ subprojects { subProject ->
|
||||||
showViolations = false
|
showViolations = false
|
||||||
ignoreFailures = true
|
ignoreFailures = true
|
||||||
}
|
}
|
||||||
// exclude generated sources
|
// exclude generated java sources - by explicitly setting the base source dir
|
||||||
// unfortunately this nice easy approach does not seem to work : http://forums.gradle.org/gradle/topics/specify_excludes_to_checkstyle_task
|
checkstyleMain.source = 'src/main/java'
|
||||||
//checkstyleMain.exclude '**/generated-src/**'
|
|
||||||
checkstyleMain.exclude '**/org/hibernate/hql/internal/antlr/**'
|
|
||||||
checkstyleMain.exclude '**/org/hibernate/hql/internal/antlr/*'
|
|
||||||
checkstyleMain.exclude '**/org/hibernate/sql/ordering/antlr/*'
|
|
||||||
checkstyleMain.exclude '**/*_$logger*'
|
|
||||||
checkstyleMain.exclude '**/org/hibernate/internal/jaxb/**'
|
|
||||||
// because cfg package is a mess mainly from annotation stuff
|
// because cfg package is a mess mainly from annotation stuff
|
||||||
checkstyleMain.exclude '**/org/hibernate/cfg/**'
|
checkstyleMain.exclude '**/org/hibernate/cfg/**'
|
||||||
checkstyleMain.exclude '**/org/hibernate/cfg/*'
|
checkstyleMain.exclude '**/org/hibernate/cfg/*'
|
||||||
|
@ -276,15 +247,8 @@ subprojects { subProject ->
|
||||||
ignoreFailures = true
|
ignoreFailures = true
|
||||||
toolVersion = '3.0.1'
|
toolVersion = '3.0.1'
|
||||||
}
|
}
|
||||||
// exclude generated sources
|
// exclude generated java sources - by explicitly setting the base source dir
|
||||||
// unfortunately this nice easy approach does not seem to work : http://forums.gradle.org/gradle/topics/specify_excludes_to_checkstyle_task
|
findbugsMain.source = 'src/main/java'
|
||||||
//findbugsMain.exclude '**/generated-src/**'
|
|
||||||
findbugsMain.exclude '**/org/hibernate/hql/internal/antlr/**'
|
|
||||||
findbugsMain.exclude '**/org/hibernate/hql/internal/antlr/*'
|
|
||||||
findbugsMain.exclude '**/org/hibernate/sql/ordering/antlr/*'
|
|
||||||
findbugsMain.exclude '**/*_$logger*'
|
|
||||||
findbugsMain.exclude '**/org/hibernate/internal/jaxb/**'
|
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue