diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ce8571b..a225869 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,7 +28,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: ./gradlew check sonarqube --no-daemon + run: ./gradlew check coverageReport sonarqube --no-daemon - name: Publish test reports uses: mikepenz/action-junit-report@v2 diff --git a/app/build.gradle b/app/build.gradle index 6bbd0b5..ac21c8c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,7 +7,6 @@ plugins { id 'org.jetbrains.kotlin.plugin.serialization' id 'com.google.gms.google-services' id 'com.google.firebase.crashlytics' - id 'com.google.firebase.firebase-perf' // https://plugins.gradle.org/plugin/com.guardsquare.appsweep id "com.guardsquare.appsweep" version "1.0.0" } @@ -54,6 +53,7 @@ android { debug { minifyEnabled true shrinkResources true + testCoverageEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro' } release { @@ -71,6 +71,12 @@ android { testOptions { unitTests { includeAndroidResources = true + all { + jacoco { + includeNoLocationClasses = true + excludes = ['jdk.internal.*'] + } + } } } @@ -178,7 +184,6 @@ dependencies { implementation platform("com.google.firebase:firebase-bom:30.0.2") implementation "com.google.firebase:firebase-analytics-ktx" implementation "com.google.firebase:firebase-crashlytics-ktx" - implementation "com.google.firebase:firebase-perf-ktx" // https://github.com/junit-team/junit4/releases testImplementation "junit:junit:4.13.2" @@ -211,5 +216,4 @@ dependencies { // https://github.com/square/leakcanary/releases debugImplementation "com.squareup.leakcanary:leakcanary-android:2.9.1" - } \ No newline at end of file diff --git a/build.gradle b/build.gradle index d12e6f0..5f430b9 100644 --- a/build.gradle +++ b/build.gradle @@ -34,6 +34,8 @@ buildscript { plugins { // https://plugins.gradle.org/plugin/org.sonarqube id "org.sonarqube" version "3.3" + // https://plugins.gradle.org/plugin/nl.neotech.plugin.rootcoverage + id "nl.neotech.plugin.rootcoverage" version "1.5.2" } task clean(type: Delete) { @@ -46,5 +48,10 @@ sonarqube { property "sonar.organization", "kirmanak" property "sonar.host.url", "https://sonarcloud.io" property "sonar.androidLint.reportPaths", "build/reports/lint-results-debug.xml" + property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco.xml" } +} + +rootCoverage { + generateXml true } \ No newline at end of file diff --git a/lint.xml b/lint.xml index 04a6f06..509af15 100644 --- a/lint.xml +++ b/lint.xml @@ -2,5 +2,7 @@ + + \ No newline at end of file