Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea89a254 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Add Jacoco coverage report task for SpaLib"

parents 84f6ed44 9f28f692
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -56,6 +56,11 @@ android {
    composeOptions {
    composeOptions {
        kotlinCompilerExtensionVersion jetpack_compose_compiler_version
        kotlinCompilerExtensionVersion jetpack_compose_compiler_version
    }
    }
    buildTypes {
        debug {
            testCoverageEnabled = true
        }
    }
}
}


dependencies {
dependencies {
@@ -63,3 +68,15 @@ dependencies {
    androidTestImplementation project(":testutils")
    androidTestImplementation project(":testutils")
    androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:2.28.1"
    androidTestImplementation "com.linkedin.dexmaker:dexmaker-mockito:2.28.1"
}
}

task coverageReport(type: JacocoReport, dependsOn: "connectedDebugAndroidTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."

    sourceDirectories.from = files("../spa/src")
    classDirectories.from = fileTree(
            dir: "../spa/build/tmp/kotlin-classes/debug",
            excludes: ["com/android/settingslib/spa/debug/**"],
    )
    executionData.from = fileTree(dir: "$buildDir/outputs/code_coverage/debugAndroidTest/connected")
}