在Azure DevOps for Android中运行JaCoCo:找不到方法jacocoTestReport()

问题描述 投票:1回答:1

我们在我们的Android Kotlin项目中实现了Jacoco,我们可以通过./gradlew clean build jacocoTestReport在本地调用。

但是,当我们部署到VSTS / Azure DevOps时,它会出现以下错误:

2019-02-04T09:37:35.5760285Z BUILD SUCCESSFUL in 12s
2019-02-04T09:37:35.5760428Z 1 actionable task: 1 executed
2019-02-04T09:37:35.5801607Z SYSTEMVSSCONNECTION exists true
2019-02-04T09:37:35.5816653Z [command]C:\Windows\system32\cmd.exe /D /S /C "C:\vstsagent\A1\_work\2\s\ApolloClient\gradlew.bat clean build jacocoRootReport"
2019-02-04T09:37:36.7652264Z 
2019-02-04T09:37:36.7653533Z FAILURE: Build failed with an exception.
2019-02-04T09:37:36.7653767Z 
2019-02-04T09:37:36.7653947Z * Where:
2019-02-04T09:37:36.7654401Z Build file 'C:\vstsagent\A1\_work\2\s\ApolloClient\build.gradle' line: 44
2019-02-04T09:37:36.7654582Z 
2019-02-04T09:37:36.7654768Z * What went wrong:
2019-02-04T09:37:36.7654952Z A problem occurred evaluating root project 'ApolloClient'.
2019-02-04T09:37:36.7655191Z > Could not find method jacocoTestReport() for arguments [build_abtyecjstjhjqmdmcxnlw2kq0$_run_closure4$_closure8@50246031] on project ':app' of type org.gradle.api.Project.
2019-02-04T09:37:36.7655365Z 
2019-02-04T09:37:36.7655547Z * Try:
2019-02-04T09:37:36.7655747Z Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
2019-02-04T09:37:36.7655931Z 
2019-02-04T09:37:36.7656098Z * Get more help at https://help.gradle.org
2019-02-04T09:37:36.7656242Z 
2019-02-04T09:37:36.7656585Z BUILD FAILED in 1s
2019-02-04T09:37:37.1999815Z Error: C:\vstsagent\A1\_work\2\s\ApolloClient\gradlew.bat failed with return code: 1
2019-02-04T09:37:37.1999996Z     at ChildProcess.<anonymous> (C:\vstsagent\A1\_work\_tasks\Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4\2.143.2\node_modules\vsts-task-lib\toolrunner.js:639:25)
2019-02-04T09:37:37.2000102Z     at emitTwo (events.js:106:13)
2019-02-04T09:37:37.2000154Z     at ChildProcess.emit (events.js:191:7)
2019-02-04T09:37:37.2000226Z     at maybeClose (internal/child_process.js:886:16)
2019-02-04T09:37:37.2000286Z     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

我不明白的是,它是在寻找一个名为jacocoRootReport或jacocoTestReport的任务吗?

kotlin azure-devops jacoco azure-pipelines-build-task
1个回答
1
投票

我无法获得实际的gradle过程来创建报告,所以我找到了解决方法

  • 将gradle任务设置为“build jacocoRootReport”
  • 使用“发布代码覆盖率结果”任务(设置为使用Jacoco)
© www.soinside.com 2019 - 2024. All rights reserved.