移动测试基础 求问:jacoco 根据 coverage.ec 生成报告报错

淼淼淼 · 2017年03月27日 · 最后由 淼淼淼 回复于 2017年03月27日 · 1548 次阅读
  • 在使用 jacoco 根据 coverage.ec 生成报告时候报错:
  • Configuration on demand is an incubating feature. The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. :app:jacocoTestReport SKIPPED
  • 附 build 代码块:
  • task jacocoTestReport(type: JacocoReport) {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ])
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/outputs/code-coverage/connected/coverage.ec")
    
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    } 
    
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 1 条回复 时间 点赞
淼淼淼 关闭了讨论 03月31日 10:30
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册