Skip to content
Snippets Groups Projects
Commit 171a3b65 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 d7648314
No related branches found
No related tags found
No related merge requests found
......@@ -18,16 +18,13 @@ allprojects {
// Plugins for subprojects
subprojects {
apply plugin: 'application'
}
apply plugin: 'java-library'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs'
}
apply plugin: 'java-library'
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,14 +67,8 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
}
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
// Subprojects quality tools tasks
subprojects {
task pmd {
group 'Quality Assurance'
description 'Run PMD'
......@@ -110,6 +77,14 @@ task pmd {
dependsOn 'pmdTest'
}
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
......@@ -117,6 +92,33 @@ task spotbugs {
dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest'
}
}
// 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"
}
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 {
eclipse {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment