Skip to content
Snippets Groups Projects
Commit e6684d19 authored by Björn Vonheiden's avatar Björn Vonheiden
Browse files

Enable code quality tools in gradle for all subprojects

Enables the execution of the code quality tools in the subprojects
and configures them in a central place.
parent 1339b3fb
No related branches found
No related tags found
1 merge request!2Gradle + CI improvements
......@@ -18,16 +18,13 @@ allprojects {
// Plugins for subprojects
subprojects {
apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs'
}
apply plugin: 'java-library'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
sourceCompatibility = "1.11"
targetCompatibility = "1.11"
......@@ -60,30 +57,6 @@ dependencies {
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
pmd {
ruleSets = [] // Gradle requires to clean the rule sets first
ruleSetFiles = files("config/pmd.xml")
ignoreFailures = false
toolVersion = "6.7.0"
}
checkstyle {
configDir = file("config")
configFile = file("config/checkstyle.xml")
maxWarnings = 0
ignoreFailures = false
toolVersion = "8.12"
}
spotbugs {
excludeFilter = file("config/spotbugs-exclude-filter.xml")
reportLevel = "low"
effort = "max"
ignoreFailures = false
toolVersion = '3.1.7'
}
// Per default XML reports for SpotBugs are generated
// Include this to generate HTML reports
tasks.withType(com.github.spotbugs.SpotBugsTask) {
......@@ -94,28 +67,57 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
}
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
// Subprojects quality tools tasks
subprojects {
task pmd {
group 'Quality Assurance'
description 'Run PMD'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
}
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
task pmd {
group 'Quality Assurance'
description 'Run PMD'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest'
}
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
// Subprojects quality tools configuration
subprojects {
pmd {
ruleSets = [] // Gradle requires to clean the rule sets first
ruleSetFiles = files("$rootProject.projectDir/config/pmd.xml")
ignoreFailures = false
toolVersion = "6.7.0"
}
dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest'
checkstyle {
configDirectory = file("$rootProject.projectDir/config")
configFile = file("$rootProject.projectDir/config/checkstyle.xml")
maxWarnings = 0
ignoreFailures = false
toolVersion = "8.12"
}
spotbugs {
excludeFilter = file("$rootProject.projectDir/config/spotbugs-exclude-filter.xml")
reportLevel = "low"
effort = "max"
ignoreFailures = false
toolVersion = '3.1.7'
}
}
allprojects {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment