@@ -4,7 +4,6 @@ import kotlinx.kover.tasks.*
4
4
/*
5
5
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
6
6
*/
7
- apply (plugin = " kover" )
8
7
9
8
val notCovered = sourceless + internal + unpublished
10
9
@@ -14,41 +13,43 @@ val expectedCoverage = mutableMapOf(
14
13
" kotlinx-coroutines-javafx" to 39 , // JavaFx is not tested on TC because its graphic subsystem cannot be initialized in headless mode
15
14
16
15
// Reactor has lower coverage in general due to various fatal error handling features
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
- }
16
+ " kotlinx-coroutines-reactor" to 75
17
+ )
18
+
19
+
32
20
33
21
subprojects {
34
22
val projectName = name
35
23
if (projectName in notCovered) return @subprojects
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
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
+ }
47
48
}
48
49
}
49
- }
50
50
51
- tasks.withType<KoverHtmlReportTask > {
52
- htmlReportDir.set(file(rootProject.buildDir.toString() + " /kover/" + project.name + " /html" ))
51
+ htmlReport {
52
+ reportDir.set(file(rootProject.buildDir.toString() + " /kover/" + project.name + " /html" ))
53
+ }
53
54
}
54
55
}
0 commit comments