如何禁用 运行 checkstyle 并仅按需执行
How to disable running checkstyle and only do it on demand
https://docs.gradle.org/current/userguide/checkstyle_plugin.html
如何在 ./gradlew build
期间禁用 运行 checkstyle 并且仅通过 ./gradlew checkstyleMain
按需执行
checkstyle {
showViolations = false
ignoreFailures = true
maxWarnings = 0
maxErrors = 0
configFile = file("checkstyle.xml")
}
这将禁止执行 checkstyleMain
任务,直到从命令行明确调用它:
checkstyleMain {
enabled = gradle.startParameter.taskNames.contains('checkstyleMain')
}
https://docs.gradle.org/current/userguide/checkstyle_plugin.html
如何在 ./gradlew build
期间禁用 运行 checkstyle 并且仅通过 ./gradlew checkstyleMain
checkstyle {
showViolations = false
ignoreFailures = true
maxWarnings = 0
maxErrors = 0
configFile = file("checkstyle.xml")
}
这将禁止执行 checkstyleMain
任务,直到从命令行明确调用它:
checkstyleMain {
enabled = gradle.startParameter.taskNames.contains('checkstyleMain')
}