Skip to content

Commit 7d0d4a4

Browse files
committed
Revert "Update Kover to 0.6.0-Beta (#3386)"
This reverts commit 79e32f7.
1 parent a673480 commit 7d0d4a4

File tree

4 files changed

+43
-44
lines changed

4 files changed

+43
-44
lines changed

buildSrc/src/main/kotlin/kover-conventions.gradle.kts

+30-31
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import kotlinx.kover.tasks.*
44
/*
55
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
66
*/
7+
apply(plugin = "kover")
78

89
val notCovered = sourceless + internal + unpublished
910

@@ -13,43 +14,41 @@ val expectedCoverage = mutableMapOf(
1314
"kotlinx-coroutines-javafx" to 39, // JavaFx is not tested on TC because its graphic subsystem cannot be initialized in headless mode
1415

1516
// Reactor has lower coverage in general due to various fatal error handling features
16-
"kotlinx-coroutines-reactor" to 75
17-
)
18-
19-
17+
"kotlinx-coroutines-reactor" to 75)
18+
19+
extensions.configure<KoverExtension> {
20+
disabledProjects = notCovered
21+
/*
22+
* Is explicitly enabled on TC in a separate build step.
23+
* Examples:
24+
* ./gradlew :p:check -- doesn't verify coverage
25+
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
26+
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
27+
*/
28+
isDisabled = !(properties["kover.enabled"]?.toString()?.toBoolean() ?: false)
29+
// TODO remove when updating Kover to version 0.5.x
30+
intellijEngineVersion.set("1.0.657")
31+
}
2032

2133
subprojects {
2234
val projectName = name
2335
if (projectName in notCovered) return@subprojects
24-
apply(plugin = "kover")
25-
26-
extensions.configure<KoverProjectConfig> {
27-
/*
28-
* Is explicitly enabled on TC in a separate build step.
29-
* Examples:
30-
* ./gradlew :p:check -- doesn't verify coverage
31-
* ./gradlew :p:check -Pkover.enabled=true -- verifies coverage
32-
* ./gradlew :p:koverReport -Pkover.enabled=true -- generates report
33-
*/
34-
isDisabled.set(!(properties["kover.enabled"]?.toString()?.toBoolean() ?: false))
35-
36-
verify {
37-
rule {
38-
bound {
39-
/*
40-
* 85 is our baseline that we aim to raise to 90+.
41-
* Missing coverage is typically due to bugs in the agent
42-
* (e.g. signatures deprecated with an error are counted),
43-
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
44-
* but some places are definitely worth visiting.
45-
*/
46-
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
47-
}
36+
tasks.withType<KoverVerificationTask> {
37+
rule {
38+
bound {
39+
/*
40+
* 85 is our baseline that we aim to raise to 90+.
41+
* Missing coverage is typically due to bugs in the agent
42+
* (e.g. signatures deprecated with an error are counted),
43+
* sometimes it's various diagnostic `toString` or `catch` for OOMs/VerificationErrors,
44+
* but some places are definitely worth visiting.
45+
*/
46+
minValue = expectedCoverage[projectName] ?: 85 // COVERED_LINES_PERCENTAGE
4847
}
4948
}
49+
}
5050

51-
htmlReport {
52-
reportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
53-
}
51+
tasks.withType<KoverHtmlReportTask> {
52+
htmlReportDir.set(file(rootProject.buildDir.toString() + "/kover/" + project.name + "/html"))
5453
}
5554
}

reactive/kotlinx-coroutines-reactive/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ val commonKoverExcludes = listOf(
4141
"kotlinx.coroutines.reactive.ConvertKt" // Deprecated
4242
)
4343

44-
kover {
45-
filters {
46-
classes {
47-
excludes += commonKoverExcludes
48-
}
49-
}
44+
tasks.koverHtmlReport {
45+
excludes = commonKoverExcludes
46+
}
47+
48+
tasks.koverVerify {
49+
excludes = commonKoverExcludes
5050
}

reactive/kotlinx-coroutines-reactor/build.gradle.kts

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ val commonKoverExcludes = listOf(
3333
"kotlinx.coroutines.reactor.ConvertKt\$asFlux$1" // Deprecated
3434
)
3535

36-
kover {
37-
filters {
38-
classes {
39-
excludes += commonKoverExcludes
40-
}
41-
}
36+
tasks.koverHtmlReport {
37+
excludes = commonKoverExcludes
38+
}
39+
40+
tasks.koverVerify {
41+
excludes = commonKoverExcludes
4242
}

ui/kotlinx-coroutines-android/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ open class RunR8 : JavaExec() {
115115

116116
tasks.withType<Test> {
117117
extensions.configure<KoverTaskExtension> {
118-
excludes.addAll(listOf("com.android.*", "android.*")) // Exclude robolectric-generated classes
118+
excludes = excludes + listOf("com.android.*", "android.*") // Exclude robolectric-generated classes
119119
}
120120
}

0 commit comments

Comments
 (0)