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 { ...@@ -18,16 +18,13 @@ allprojects {
// Plugins for subprojects // Plugins for subprojects
subprojects { subprojects {
apply plugin: 'application' apply plugin: 'application'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'com.github.spotbugs'
} }
apply plugin: 'java-library' apply plugin: 'java-library'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
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,28 +67,57 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) { ...@@ -94,28 +67,57 @@ tasks.withType(com.github.spotbugs.SpotBugsTask) {
} }
} }
task checkstyle { // Subprojects quality tools tasks
group 'Quality Assurance' subprojects {
description 'Run Checkstyle' task pmd {
group 'Quality Assurance'
description 'Run PMD'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
}
dependsOn 'checkstyleMain' task checkstyle {
dependsOn 'checkstyleTest' group 'Quality Assurance'
} description 'Run Checkstyle'
task pmd { dependsOn 'checkstyleMain'
group 'Quality Assurance' dependsOn 'checkstyleTest'
description 'Run PMD' }
task spotbugs {
group 'Quality Assurance'
description 'Run SpotBugs'
dependsOn 'pmdMain' dependsOn 'spotbugsMain'
dependsOn 'pmdTest' dependsOn 'spotbugsTest'
}
} }
task spotbugs { // Subprojects quality tools configuration
group 'Quality Assurance' subprojects {
description 'Run SpotBugs' 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' checkstyle {
dependsOn 'spotbugsTest' 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 {
......
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