File tree Expand file tree Collapse file tree 4 files changed +21
-9
lines changed
build-logic/plugins/src/main/kotlin Expand file tree Collapse file tree 4 files changed +21
-9
lines changed Original file line number Diff line number Diff 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 }}
Original file line number Diff line number Diff line change 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
1717import org.gradle.api.Plugin
1818import org.gradle.api.Project
1919import 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 }
Original file line number Diff line number Diff 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+
2534dependencies {
2635 // Generate combined coverage report
2736 kover(project(" :authenticator" ))
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ futures = "1.1.0"
1616junit = " 4.13.2"
1717kotest = " 5.7.1"
1818kotlin = " 1.9.10"
19- kover = " 0.7.2 "
19+ kover = " 0.9.1 "
2020ktlint = " 11.0.0"
2121licensee = " 1.7.0"
2222lifecycle = " 2.4.0"
You can’t perform that action at this time.
0 commit comments