1 Star 0 Fork 0

冷空气却清晰/Alerter

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
quality.gradle 2.49 KB
一键复制 编辑 原始数据 按行查看 历史
//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'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/caojingCode/Alerter.git
git@gitee.com:caojingCode/Alerter.git
caojingCode
Alerter
Alerter
master

搜索帮助