Last active
August 29, 2020 07:59
-
-
Save easternHong/a1a637721529fd001b96 to your computer and use it in GitHub Desktop.
android studio gradle checkstyle findbugs pmd lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go to https://github.com/easternHong/vb-android-app-quality | |
//get the config file and put them into app/config/.. | |
apply plugin: 'pmd' | |
apply plugin: 'findbugs' | |
apply plugin: 'checkstyle' | |
task findbugs(type: FindBugs) { | |
description 'Run findbugs' | |
group 'verification' | |
classes = fileTree('build/intermediates/classes/debug/') | |
source = fileTree('src/main/java') | |
classpath = files() | |
effort = 'max' | |
reportLevel = "high" | |
ignoreFailures = true | |
excludeFilter = file("config/quality/findbugs/findbugs-filter.xml") | |
reports { | |
xml.enabled = false | |
html.enabled = true | |
html { | |
destination "$project.buildDir/reports/findbugs/findbugs-output.html" | |
} | |
} | |
} | |
task pmd(type: Pmd) { | |
ignoreFailures = true | |
ruleSetFiles = files("config/quality/pmd/pmd-ruleset.xml") | |
ruleSets = [] | |
//source 'src' | |
source = fileTree('src/main/java') | |
include '**/*.java' | |
exclude '**/gen/**' | |
reports { | |
//xml.enabled = false | |
html.enabled = true | |
// xml { | |
// destination "$project.buildDir/reports/pmd/pmd.xml" | |
// } | |
html { | |
destination "$project.buildDir/reports/pmd/pmd.html" | |
} | |
} | |
} | |
task checkstyle(type: Checkstyle) { | |
ignoreFailures = true | |
configFile file("config/quality/checkstyle/checkstyle.xml") | |
configProperties.checkstyleSuppressionsPath = file("config/quality/checkstyle/suppressions.xml").absolutePath | |
source = fileTree('src/main/java') | |
include '**/*.java' | |
exclude '**/gen/**' | |
classpath = files() | |
reports { | |
xml.enabled = true | |
// html.enabled = true | |
xml { | |
destination "$project.buildDir/reports/checkstyle/checkstyle.xml" | |
} | |
// html { | |
// destination "$project.buildDir/reports/checkstyle/checkstyle.html" | |
// } | |
} | |
} | |
check.doLast { | |
project.tasks.getByName("findbugs").execute() | |
project.tasks.getByName("pmd").execute() | |
project.tasks.getByName("checkstyle").execute() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment