File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,13 @@ steps:
6868 javaHomeOption : ' JDKVersion'
6969 sonarQubeRunAnalysis : false
7070
71+ - task : PublishCodeCoverageResults@1
72+ inputs :
73+ codeCoverageTool : ' JaCoCo'
74+ summaryFileLocation : $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml
75+ pathToSources : $(System.DefaultWorkingDirectory)/src/main/java
76+ failIfCoverageEmpty : true
77+
7178- task : PublishBuildArtifacts@1
7279 displayName : ' Publish Artifact: drop'
7380 inputs :
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ steps:
5252 javaHomeOption : ' JDKVersion'
5353 sonarQubeRunAnalysis : false
5454
55+ - task : PublishCodeCoverageResults@1
56+ inputs :
57+ codeCoverageTool : ' JaCoCo'
58+ summaryFileLocation : $(System.DefaultWorkingDirectory)/build/reports/jacoco/test/jacocoTestReport.xml
59+ pathToSources : $(System.DefaultWorkingDirectory)/src/main/java
60+ failIfCoverageEmpty : true
61+
5562- task : YodLabs.O365PostMessage.O365PostMessageBuild.O365PostMessageBuild@0
5663 displayName : ' Graph Client Tooling pipeline fail notification'
5764 inputs :
Original file line number Diff line number Diff line change @@ -14,12 +14,30 @@ plugins {
1414 id ' maven-publish'
1515 id ' signing'
1616 id ' com.jfrog.bintray' version ' 1.8.5'
17+ id ' jacoco'
1718}
1819
1920java {
2021 modularity. inferModulePath = true
2122}
2223
24+ test {
25+ finalizedBy jacocoTestReport // report is always generated after tests run
26+ }
27+ jacocoTestReport {
28+ dependsOn test // tests are required to run before generating the report
29+ }
30+
31+ jacoco {
32+ toolVersion = " 0.8.7-SNAPSHOT" // https://github.com/gradle/gradle/issues/15038
33+ }
34+
35+ jacocoTestReport {
36+ reports {
37+ xml. enabled true
38+ }
39+ }
40+
2341sourceSets {
2442 main {
2543 java {
@@ -34,6 +52,7 @@ repositories {
3452 // You can declare any Maven/Ivy/file repository here.
3553 jcenter()
3654 mavenCentral()
55+ maven { url ' https://oss.sonatype.org/content/repositories/snapshots' } // for jacoco, until 0.8.7 gets released
3756}
3857
3958apply from : " gradle/dependencies.gradle"
You can’t perform that action at this time.
0 commit comments