代码拉取完成,页面将自动刷新
//noinspection GrPackage
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'pmd'
final String QUALITY_DIR = "quality"
final String SOURCE = "src"
final String INCLUDE_JAVA = "**/*.java"
final String EXCLUDE_GENERATED = "**/gen/**"
android {
lintOptions {
abortOnError true
xmlReport false
htmlReport true
lintConfig file("${project.rootDir}/${QUALITY_DIR}/lint/lint.xml")
htmlOutput file("$project.buildDir/reports/lint/lint-result.html")
xmlOutput file("$project.buildDir/reports/lint/lint-result.xml")
}
}
checkstyle {
toolVersion = '7.5'
}
/*
* Check Styles - is a development tool to help programmers write Java code that adheres to a coding standard.
*/
task checkstyle(type: Checkstyle) {
configFile = file("${rootProject.rootDir}/${QUALITY_DIR}/checkstyle/checkstyle.xml")
def suppressionsFile = new File("${project.rootDir}/${QUALITY_DIR}/checkstyle/suppressions.xml")
configProperties.checkstyleSuppressionsPath = suppressionsFile.absolutePath
source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED
classpath = files()
}
/*
* Find Bugs - a program which uses static analysis to look for bugs in Java code.
*/
task findbugs(type: FindBugs) {
ignoreFailures = false
effort = "max"
reportLevel = "high"
excludeFilter = new File("${project.rootDir}/${QUALITY_DIR}/findbugs/findbugs-filter.xml")
classes = files("${project.buildDir}/intermediates/classes")
source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED
reports {
xml.enabled = false
html.enabled = true
xml {
destination new File("$project.buildDir/reports/findbugs/findbugs.xml")
}
html {
destination new File("$project.buildDir/reports/findbugs/findbugs.html")
}
}
classpath = files()
}
/*
* Programming Mistake Detector - a source code analyzer. It finds common programming flaws.
*/
task pmd(type: Pmd) {
ignoreFailures = false
ruleSetFiles = files("${project.rootDir}/${QUALITY_DIR}/pmd/pmd-ruleset.xml")
ruleSets = []
source SOURCE
include INCLUDE_JAVA
exclude EXCLUDE_GENERATED
reports {
xml.enabled = false
html.enabled = true
xml {
destination new File("$project.buildDir/reports/pmd/pmd.xml")
}
html {
destination new File("$project.buildDir/reports/pmd/pmd.html")
}
}
}
check.dependsOn 'lint'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。