Skip to content

Commit a5ad0d5

Browse files
authored
Merge branch 'main' into fix/update-skill-gemini-model
2 parents df48561 + 2344932 commit a5ad0d5

5 files changed

Lines changed: 16 additions & 50 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
4646

4747
- name: Build modules
48-
run: ./gradlew build jacocoTestReport -x :maps-app:generateDebugScreenshotTestConfig -x :maps-app:generateReleaseScreenshotTestConfig --stacktrace
48+
run: ./gradlew build koverXmlReportDebug -x :maps-app:generateDebugScreenshotTestConfig -x :maps-app:generateReleaseScreenshotTestConfig --stacktrace
4949

5050
- name: Run Screenshot Tests
5151
run: ./gradlew :maps-app:validateDebugScreenshotTest

build-logic/convention/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies {
2929
implementation(libs.kotlin.gradle.plugin)
3030
implementation(libs.android.gradle.plugin)
3131
implementation(libs.dokka.plugin)
32-
implementation(libs.org.jacoco.core)
32+
implementation(libs.kover.gradle.plugin)
3333
implementation(libs.gradle.maven.publish.plugin)
3434

3535
}

build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,68 +17,37 @@
1717
// buildSrc/src/main/kotlin/PublishingConventionPlugin.kt
1818
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
1919
import com.vanniktech.maven.publish.MavenPublishBaseExtension
20+
import kotlinx.kover.gradle.plugin.dsl.KoverProjectExtension
2021
import org.gradle.api.Plugin
2122
import org.gradle.api.Project
2223
import org.gradle.kotlin.dsl.*
23-
import org.gradle.testing.jacoco.plugins.JacocoPluginExtension
24-
import org.gradle.api.tasks.testing.Test
25-
import org.gradle.testing.jacoco.plugins.JacocoTaskExtension
26-
import org.gradle.testing.jacoco.tasks.JacocoReport
2724

2825
class PublishingConventionPlugin : Plugin<Project> {
2926
override fun apply(project: Project) {
3027
project.run {
3128

3229
applyPlugins()
33-
configureJacoco()
30+
configureKover()
3431
configureVanniktechPublishing()
3532
}
3633
}
3734

3835
private fun Project.applyPlugins() {
3936
apply(plugin = "com.android.library")
4037
apply(plugin = "org.jetbrains.dokka")
41-
apply(plugin = "org.gradle.jacoco")
38+
apply(plugin = "org.jetbrains.kotlinx.kover")
4239
apply(plugin = "com.vanniktech.maven.publish")
4340
}
4441

45-
private fun Project.configureJacoco() {
46-
configure<JacocoPluginExtension> {
47-
toolVersion = "0.8.15" // Compatible with newer JDKs
48-
}
49-
50-
// AGP 9.0+ built-in Jacoco support or manual configuration.
51-
// We create a "jacocoTestReport" task to match the CI workflow.
52-
53-
tasks.register<JacocoReport>("jacocoTestReport") {
54-
// Dependencies
55-
dependsOn("testDebugUnitTest")
56-
57-
reports {
58-
xml.required.set(true)
59-
html.required.set(true)
60-
}
61-
62-
// Source directories
63-
val mainSrc = "${layout.projectDirectory}/src/main/java"
64-
sourceDirectories.setFrom(files(mainSrc))
65-
66-
// Class directories - AGP 9's built-in Kotlin compiler outputs to
67-
// intermediates/built_in_kotlinc/, not the legacy tmp/kotlin-classes/ path.
68-
classDirectories.setFrom(
69-
fileTree(layout.buildDirectory.dir("intermediates/built_in_kotlinc/debug")) {
70-
include("**/classes/**")
71-
},
72-
fileTree(layout.buildDirectory.dir("intermediates/javac/debug")) {
73-
include("**/classes/**")
74-
exclude("**/R.class", "**/R\$*.class", "**/BuildConfig.class")
75-
}
76-
)
77-
78-
// Execution data from the unit test task
79-
executionData.setFrom(fileTree(layout.buildDirectory.get()) {
80-
include("outputs/unit_test_code_coverage/debugUnitTest/testDebugUnitTest.exec")
81-
})
42+
private fun Project.configureKover() {
43+
configure<KoverProjectExtension> {
44+
reports {
45+
filters {
46+
excludes {
47+
androidGeneratedClasses()
48+
}
49+
}
50+
}
8251
}
8352
}
8453

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ buildscript {
2525
classpath(libs.maps.secrets.plugin)
2626
classpath(libs.kotlin.gradle.plugin)
2727
classpath(libs.dokka.plugin)
28-
classpath(libs.jacoco.android.plugin)
2928
}
3029
}
3130

gradle/libs.versions.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ junit = "4.13.2"
3939
junitktx = "1.3.0"
4040
leakcanaryAndroid = "2.14"
4141
mockk = "1.14.11"
42-
org-jacoco-core = "0.8.15"
43-
jacoco-plugin = "0.2.1"
42+
kover = "0.9.9"
4443
robolectric = "4.16.1"
4544
screenshot = "0.0.1-alpha14"
4645
truth = "1.4.5"
@@ -83,12 +82,11 @@ androidx-test-espresso = { module = "androidx.test.espresso:espresso-core", vers
8382
androidx-test-junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitktx" }
8483
androidx-test-rules = { module = "androidx.test:rules", version.ref = "androidCore" }
8584
androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxtest" }
86-
jacoco-android-plugin = { module = "com.mxalbert.gradle:jacoco-android", version.ref = "jacoco-plugin" }
8785
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
8886
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" }
8987
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
9088
mockk-android = { group = "io.mockk", name = "mockk-android", version.ref = "mockk" }
91-
org-jacoco-core = { module = "org.jacoco:org.jacoco.core", version.ref = "org-jacoco-core" }
89+
kover-gradle-plugin = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version.ref = "kover" }
9290
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
9391
screenshot-validation-api = { group = "com.android.tools.screenshot", name = "screenshot-validation-api", version.ref = "screenshot" }
9492
test-junit = { module = "junit:junit", version.ref = "junit" }

0 commit comments

Comments
 (0)