我有一个Gradle任务可以将jacoco覆盖上传到TeamCity(在此处的TeamCity文档之后:Importing JaCoCo coverage data to TeamCity):
task uploadJacocoTestReport {
doLast {
println "##teamcity[jacocoReport dataPath='build/jacoco/jacocoTest.exec' " +
"includes='com.mypackage.*' " +
"classpath='build/classes/main']"
}
}
如果我使用Gradle 3.5
,则TeamCity构建能够在构建日志中显示CodeCoverage报告。但是,当我切换到Gradle 4.5
时,代码覆盖率部分不再出现在构建日志中。如何使用Gradle 4.5上传jacoco报告?
TeamCity版本10.0.5 (build 42677)
jacoco version 0.8.0
答案 0 :(得分:1)
我在团队合作方面也遇到了同样的问题,它向我显示了下一条消息:
[Generating JaCoCo coverage...] JaCoCo report generation failed. Exit code: 1
尝试使用:
println "##teamcity[jacocoReport dataPath='$project.buildDir/jacoco/jacocoTest.exec' ...]"
代替:
println "##teamcity[jacocoReport dataPath='build/jacoco/jacocoTest.exec' ...]"
答案 1 :(得分:0)