Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Moved code quality setup to separate gradle script.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Lord committed Jul 29, 2016
1 parent dfc05ac commit 302ac73
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 74 deletions.
75 changes: 1 addition & 74 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,80 +15,7 @@ allprojects {
}
}

subprojects { project ->

apply plugin: 'checkstyle'

checkstyle {
toolVersion '7.0'
}

task checkstyle(type: Checkstyle) {
group "Verification"

configFile rootProject.file('config/checkstyle/checkstyle.xml')
source 'src'
include '**/*.java'
ignoreFailures false
showViolations true

classpath = files()

reports {
xml.enabled = true
html.enabled true
}
}

apply plugin: 'findbugs'

findbugs {
toolVersion '3.0.1'
}

task findbugs(type: FindBugs) {
group "Verification"

excludeFilter = rootProject.file('config/findbugs/findbugs-filter.xml')
classes = files(project.file('build/intermediates/classes'))
source = fileTree('src/main/java/')
ignoreFailures = false
effort = "max"
reportLevel = "high"

classpath = files()

reports {
xml.enabled = false
html.enabled = true
}
}

apply plugin: 'pmd'

pmd {
toolVersion '5.5.1'
}

task pmd(type: Pmd) {
group 'verification'

ruleSetFiles = rootProject.files('config/pmd/pmd-ruleset.xml')
source = fileTree('src/main/java/')

reports {
xml.enabled = false
html.enabled = true
}
}

afterEvaluate {
check.dependsOn('checkstyle')
check.dependsOn('findbugs')
check.dependsOn('pmd')
}

}
apply from: 'quality-checks.gradle'

task clean(type: Delete) {
delete rootProject.buildDir
Expand Down
74 changes: 74 additions & 0 deletions quality-checks.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
subprojects { project ->

apply plugin: 'checkstyle'

checkstyle {
toolVersion '7.0'
}

task checkstyle(type: Checkstyle) {
group "Verification"

configFile rootProject.file('config/checkstyle/checkstyle.xml')
source 'src'
include '**/*.java'
ignoreFailures false
showViolations true

classpath = files()

reports {
xml.enabled = true
html.enabled true
}
}

apply plugin: 'findbugs'

findbugs {
toolVersion '3.0.1'
}

task findbugs(type: FindBugs) {
group "Verification"

excludeFilter = rootProject.file('config/findbugs/findbugs-filter.xml')
classes = files(project.file('build/intermediates/classes'))
source = fileTree('src/main/java/')
ignoreFailures = false
effort = "max"
reportLevel = "high"

classpath = files()

reports {
xml.enabled = false
html.enabled = true
}
}

apply plugin: 'pmd'

pmd {
toolVersion '5.5.1'
}

task pmd(type: Pmd) {
group 'verification'

ruleSetFiles = rootProject.files('config/pmd/pmd-ruleset.xml')
source = fileTree('src/main/java/')

reports {
xml.enabled = false
html.enabled = true
}
}

afterEvaluate {
check.dependsOn('checkstyle')
check.dependsOn('findbugs')
check.dependsOn('pmd')
}

}

0 comments on commit 302ac73

Please sign in to comment.