2017-09-12 29 views
1

我需要在Microsoft Visual Studio Team中打开JaCoCo覆盖报告。如何为Microsoft Visual Studio Team创建JaCoCo xml报告和xml摘要?

我可以看到形式:

enter image description here

所以,我需要总结的文件。我如何创建它?
这是真的,我需要在本地创建一个XML格式的报告?

我想创建这个报告,但我有一个问题。
我的项目中使用摇篮,所以我加入这gradle.build

apply plugin: "jacoco" 

和:

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
     testCoverageEnabled true 
    } 
} 

但我不能看到任何jacoco报告。
我可以用Android studio创建一个完整的jacoco报告,但它是唯一的html。

如何创建Microsoft Visual Studio Team的摘要?

+0

其中建立任务?在Gradle任务中有代码覆盖配置,运行带代码覆盖率的测试任务,然后它将上传代码覆盖率。 –

+0

我使用这个配置:https://stackoverflow.com/questions/46193721/how-to-create-xml-and-html-reports-for-jacoco-with-gradle构建成功,但没有报告 – NaSt

回答

0

对于Jacoco配置,您可以参考此处的代码示例:Gradle Example。我已经测试过它,它可以正确生成XML报告。

然后你就可以运行构建和发布从VSTS代码覆盖的结果:在VSTS enter image description here

发布结果:你使用 enter image description here