Skip to content

Commit ab7ba13

Browse files
authored
chore: Upgrade kover to 0.9.1 (#238)
1 parent 641b61a commit ab7ba13

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

.github/workflows/codecov_code_coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ jobs:
2222
distribution: 'corretto'
2323

2424
- name: Run test and generate kover report
25-
run: ./gradlew koverXmlReport
25+
run: ./gradlew koverXmlReportCoverage
2626

2727
- name: Upload Test Report
2828
uses: codecov/codecov-action@v5
2929
with:
3030
name: report
31-
files: build/reports/kover/report.xml
31+
files: build/reports/kover/reportCoverage.xml
3232
token: ${{ secrets.CODECOV_TOKEN }}

build-logic/plugins/src/main/kotlin/KoverConventionPlugin.kt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16-
import kotlinx.kover.gradle.plugin.dsl.KoverReportExtension
16+
import kotlinx.kover.gradle.plugin.dsl.KoverProjectExtension
1717
import org.gradle.api.Plugin
1818
import org.gradle.api.Project
1919
import org.gradle.kotlin.dsl.configure
@@ -25,11 +25,14 @@ class KoverConventionPlugin : Plugin<Project> {
2525
override fun apply(target: Project) {
2626
with(target) {
2727
pluginManager.apply("org.jetbrains.kotlinx.kover")
28-
29-
extensions.configure<KoverReportExtension> {
30-
defaults {
31-
// Use the release variant for the default coverage report
32-
mergeWith("release")
28+
extensions.configure<KoverProjectExtension> {
29+
currentProject {
30+
createVariant("coverage") {
31+
add("release") // Use release variant for generating coverage reports
32+
}
33+
}
34+
reports {
35+
filters.excludes.androidGeneratedClasses()
3336
}
3437
}
3538
}

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ tasks.register<Delete>("clean").configure {
2222
delete(rootProject.buildDir)
2323
}
2424

25+
kover {
26+
currentProject {
27+
createVariant("coverage") {
28+
// Use a custom variant called "coverage" to generate the merged report. This variant only runs the tests
29+
// for the release variant.
30+
}
31+
}
32+
}
33+
2534
dependencies {
2635
// Generate combined coverage report
2736
kover(project(":authenticator"))

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ futures = "1.1.0"
1616
junit = "4.13.2"
1717
kotest = "5.7.1"
1818
kotlin = "1.9.10"
19-
kover = "0.7.2"
19+
kover = "0.9.1"
2020
ktlint = "11.0.0"
2121
licensee = "1.7.0"
2222
lifecycle = "2.4.0"

0 commit comments

Comments
 (0)