@@ -4,6 +4,7 @@ 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" )
7
8
8
9
val notCovered = sourceless + internal + unpublished
9
10
@@ -13,43 +14,41 @@ val expectedCoverage = mutableMapOf(
13
14
" kotlinx-coroutines-javafx" to 39 , // JavaFx is not tested on TC because its graphic subsystem cannot be initialized in headless mode
14
15
15
16
// 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
+ }
20
32
21
33
subprojects {
22
34
val projectName = name
23
35
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
48
47
}
49
48
}
49
+ }
50
50
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" ))
54
53
}
55
54
}
0 commit comments