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 { ...@@ -18,16 +18,13 @@ allprojects {
// Plugins for subprojects // Plugins for subprojects
subprojects { subprojects {
apply plugin: 'application' apply plugin: 'application'
}
apply plugin: 'java-library'
apply plugin: 'pmd'
apply plugin: 'checkstyle' apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs' apply plugin: 'com.github.spotbugs'
}
apply plugin: 'java-library'
sourceCompatibility = "1.11" sourceCompatibility = "1.11"
targetCompatibility = "1.11" targetCompatibility = "1.11"
...@@ -60,30 +57,6 @@ dependencies { ...@@ -60,30 +57,6 @@ dependencies {
// Use JUnit test framework // Use JUnit test framework
testImplementation 'junit:junit:4.12' 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 // Per default XML reports for SpotBugs are generated
// Include this to generate HTML reports // Include this to generate HTML reports
tasks.withType(com.github.spotbugs.SpotBugsTask) { tasks.withType(com.github.spotbugs.SpotBugsTask) {
...@@ -94,14 +67,8 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) { ...@@ -94,14 +67,8 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
} }
} }
task checkstyle { // Subprojects quality tools tasks
group 'Quality Assurance' subprojects {
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task pmd { task pmd {
group 'Quality Assurance' group 'Quality Assurance'
description 'Run PMD' description 'Run PMD'
...@@ -110,6 +77,14 @@ task pmd { ...@@ -110,6 +77,14 @@ task pmd {
dependsOn 'pmdTest' dependsOn 'pmdTest'
} }
task checkstyle {
group 'Quality Assurance'
description 'Run Checkstyle'
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
}
task spotbugs { task spotbugs {
group 'Quality Assurance' group 'Quality Assurance'
description 'Run SpotBugs' description 'Run SpotBugs'
...@@ -117,6 +92,33 @@ task spotbugs { ...@@ -117,6 +92,33 @@ task spotbugs {
dependsOn 'spotbugsMain' dependsOn 'spotbugsMain'
dependsOn 'spotbugsTest' 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 { allprojects {
eclipse { eclipse {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment