Skip to content

Commit edb252a

Browse files
committed
ci: update jacoco configuration
1 parent 90a26cb commit edb252a

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

app/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,16 @@ android {
201201
buildConfig = true
202202
}
203203

204+
kapt {
205+
// Fix for KAPT issues
206+
useBuildCache = true
207+
arguments {
208+
arg("room.schemaLocation", "$projectDir/schemas")
209+
arg("room.incremental", "true")
210+
arg("room.expandProjection", "true")
211+
}
212+
}
213+
204214
configurations.all {
205215
resolutionStrategy {
206216
preferProjectModules()

commons/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ android {
5050
viewBinding = true
5151
}
5252

53+
kapt {
54+
// Fix for KAPT issues
55+
useBuildCache = true
56+
arguments {
57+
arg("room.schemaLocation", "$projectDir/schemas")
58+
arg("room.incremental", "true")
59+
arg("room.expandProjection", "true")
60+
}
61+
}
62+
5363
configurations.all {
5464
resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS)
5565
}

jacoco/jacoco-kmp.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ tasks.register("jacocoReport", JacocoReport::class) {
88
group = "Coverage"
99
description = "Generate XML/HTML code coverage reports"
1010

11+
// Only run JaCoCo for debug builds to avoid KAPT issues in release builds
12+
onlyIf {
13+
!gradle.startParameter.taskNames.any { it.contains("Release") || it.contains("release") }
14+
}
15+
1116
// Set source directories based on project type
1217
if (isKmpProject) {
1318
// For KMP projects, include all source sets

jacoco/jacoco.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ tasks.register("jacocoReport", JacocoReport::class) {
44
group = "Coverage"
55
description = "Generate XML/HTML code coverage reports for coverage.ec"
66

7+
// Only run JaCoCo for debug builds to avoid KAPT issues in release builds
8+
onlyIf {
9+
!gradle.startParameter.taskNames.any { it.contains("Release") || it.contains("release") }
10+
}
11+
712
// Make sure tests are run before generating the report
813
// Only add dependencies if the tasks exist
914
val testTask = tasks.findByName("testDebugUnitTest")

0 commit comments

Comments
 (0)