Skip to content

Commit ec2fa78

Browse files
committed
Replace Jacoco with Kover
1 parent 793538f commit ec2fa78

File tree

6 files changed

+92
-258
lines changed

6 files changed

+92
-258
lines changed

.github/release_notes_dependency_list.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"org.bitbucket.b_c:jose4j" = ""
7171
"org.jetbrains.dokka" = ""
7272
"org.jetbrains.kotlinx.binary-compatibility-validator" = ""
73+
"org.jetbrains.kotlinx.kover" = ""
7374
"org.jetbrains.kotlinx:kotlinx-coroutines-test" = ""
7475
"org.json:json" = ""
7576
"org.junit.jupiter:junit-jupiter-api" = ""

.github/workflows/sonar_cloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ jobs:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
4040
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4141
run: |
42-
./gradlew detekt assDeb jacocoDebugTestReport lintDeb -Pstrip-resources=true
42+
./gradlew detekt assDeb koverXmlReport lintDeb -Pstrip-resources=true
4343
./gradlew sonar

config/gradle/codeQuality.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
* Created by ran on 6/2/2019.
77
*/
88

9-
apply from: "${rootDir}/config/gradle/jacoco.gradle"
9+
apply from: "${rootDir}/config/gradle/kover.gradle"
1010
apply from: "${rootDir}/config/gradle/ktlint.gradle"
1111
apply from: "${rootDir}/config/gradle/detekt.gradle"

config/gradle/jacoco.gradle

Lines changed: 0 additions & 252 deletions
This file was deleted.

config/gradle/kover.gradle

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// cannot reference the plugins declared in the version catalogs here because it requires the use of the `plugins` block instead of the `apply plugin` command
2+
// the `plugins` block cannot be used in gradle files such as this one, which are imported into other gradle files with the `apply from` command
3+
apply plugin: 'org.jetbrains.kotlinx.kover'
4+
5+
if (project.hasProperty('android')) {
6+
android.buildTypes {
7+
debug {
8+
testCoverageEnabled = true
9+
}
10+
}
11+
}
12+
13+
kover {
14+
reports {
15+
filters {
16+
excludes {
17+
classes(
18+
// Android
19+
"*.BuildConfig",
20+
21+
// Data binding
22+
"*.databinding.*",
23+
24+
// Activities, fragments, views, etc.
25+
"*.*Activity",
26+
"*.*Activity\$*",
27+
"*.*Fragment",
28+
"*.*Fragment\$*",
29+
"*.*View",
30+
"*.*View\$*",
31+
"*.*ViewHolder",
32+
"*.*ViewHolder\$*",
33+
34+
// Compose
35+
"*.ComposableSingletons",
36+
"*.ComposableSingletons\$*",
37+
38+
// Parcelize
39+
"*.*\$Creator",
40+
41+
// Custom views not following *View naming
42+
"*.AddressFormInput",
43+
"*.AdyenSwipeToRevealLayout",
44+
"*.AdyenTextInputEditText",
45+
"*.CardNumberInput",
46+
"*.DefaultPayButton",
47+
"*.ExpiryDateInput",
48+
"*.GiftCardNumberInput",
49+
"*.IbanInput",
50+
"*.PayButton",
51+
"*.SecurityCodeInput",
52+
"*.SocialSecurityNumberInput",
53+
54+
// Project specific files that can't be tested
55+
"*.*ComponentProvider",
56+
"*.*DropInService",
57+
"*.*ViewProvider",
58+
"*.AdyenLogKt",
59+
"*.CheckCompileOnlyKt",
60+
"*.ContextExtensionsKt",
61+
"*.DropIn",
62+
"*.DropInKt",
63+
"*.FragmentExtensionsKt",
64+
"*.FragmentProviderKt",
65+
"*.ImageLoadingExtensionsKt",
66+
"*.ImageSaver",
67+
"*.InstallmentFilter",
68+
"*.LazyArgumentsKt",
69+
"*.LifecycleExtensionsKt",
70+
"*.LogcatLogger",
71+
"*.PdfOpener",
72+
"*.ResultExtKt",
73+
"*.RunCompileOnlyKt",
74+
"*.ViewExtensionsKt",
75+
"*.ViewModelExtKt",
76+
77+
// Example-app and test-core
78+
'com.adyen.checkout.example.*',
79+
'com.adyen.checkout.test.*'
80+
)
81+
82+
annotatedBy(
83+
"androidx.compose.runtime.Composable",
84+
)
85+
}
86+
}
87+
}
88+
}

config/gradle/sonarcloud.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ subprojects {
4242
properties {
4343
property 'sonar.androidLint.reportPaths', "${layout.buildDirectory.get().asFile}/reports/lint-results-debug.xml"
4444
property 'sonar.kotlin.detekt.reportPaths', "${layout.buildDirectory.get().asFile}/reports/detekt/detekt-results.xml"
45-
property 'sonar.coverage.jacoco.xmlReportPaths', "${layout.buildDirectory.get().asFile}/reports/jacoco/jacocoDebugTestReport/jacocoDebugTestReport.xml"
46-
47-
def sonarExclusions = coverageExclusions.join(', ')
48-
property 'sonar.coverage.exclusions', sonarExclusions
45+
property 'sonar.coverage.jacoco.xmlReportPaths', "${layout.buildDirectory.get().asFile}/reports/kover/report.xml"
4946
}
5047
}
5148
}

0 commit comments

Comments
 (0)