vanniktech / gradle-android-junit-jacoco-plugin

Gradle plugin that generates JaCoCo reports from an Android Gradle Project
http://vanniktech.com
Apache License 2.0
399 stars 72 forks source link

Push coverage to Sonar not working #176

Closed fegoulart closed 4 years ago

fegoulart commented 4 years ago

Hello !

I can't push code coverage to Sonar. Any idea ?

junitJacoco {
    jacocoVersion = '0.8.5' // type String
    includeNoLocationClasses = false
    includeInstrumentationCoverageInMergedReport = false // type boolean
}
    sonarqube {
        properties {
            property "sonar.sourceEncoding", "UTF-8"
            property "sonar.jacoco.xmlReportPaths", "build/reports/jacocoCombined/debug/jacoco.xml"
            property "sonar.projectName", "project-android"
            property "sonar.projectVersion", "$System.env.CI_COMMIT_SHORT_SHA"
            property "sonar.androidVariant", "DevDebug"
        }
    }
vanniktech commented 4 years ago

Nope. Never used that feature.

tynn commented 4 years ago

The androidVariant is set to DevDebug, so you're probably missing the flavor in the report path:

build/reports/jacocoCombined/dev/debug/jacoco.xml
vanniktech commented 4 years ago

I'm closing this issue due to inactivity. If you have any further input on the issue, don't hesitate to reopen this issue or post a new one.