我有一个分级多项目构建,其中每个子项目创建自己的CodeNarc报告。
是否可能为构建中的所有项目创建一个CodeNarc分析报告,而不是为每个项目创建一个单独的报告?
发布于 2014-09-16 08:17:03
您可以创建自己的CodeNarc任务,并使用其所有子项目的源集配置它,如下所示。
task supernarc(type: CodeNarc) {
def allGroovySourceDirs = subprojects.collect { Project p -> p.sourceSets.main.allGroovy.getSrcDirs() }.flatten()
allGroovySourceDirs.each {
source(it)
}
// BTW, if you know you have some violations and don't want the builds to fail because of too many violations, you can increase the threshold as follows
maxPriority1Violations = 5
maxPriority2Violations = 5
maxPriority3Violations = 5}
我为您创建了这个吉特布样本,以便您可以看到使用它的项目。
这有用吗?
干杯,康
https://stackoverflow.com/questions/25827908
复制相似问题