File tree Expand file tree Collapse file tree 2 files changed +26
-40
lines changed
buildSrc/src/main/kotlin/io/github/petertrr Expand file tree Collapse file tree 2 files changed +26
-40
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ plugins {
77 kotlin(" multiplatform" )
88 alias(libs.plugins.detekt)
99 alias(libs.plugins.vanniktech)
10- id( " jacoco-convention " )
10+ jacoco
1111}
1212
1313group = " io.github.petertrr"
@@ -167,6 +167,10 @@ mavenPublishing {
167167 }
168168}
169169
170+ jacoco {
171+ toolVersion = " 0.8.13"
172+ }
173+
170174detekt {
171175 buildUponDefaultConfig = true
172176 config.setFrom(files(" detekt.yml" ))
@@ -177,4 +181,25 @@ tasks {
177181 check {
178182 dependsOn(detekt)
179183 }
184+
185+ val jvmTest = named<Test >(" jvmTest" )
186+ val jacocoReport = register<JacocoReport >(" jacocoTestReport" ) {
187+ dependsOn(jvmTest)
188+
189+ val commonMainSources = kotlin.sourceSets[" commonMain" ].kotlin.sourceDirectories
190+ val jvmMainSources = kotlin.sourceSets[" jvmMain" ].kotlin.sourceDirectories
191+
192+ sourceDirectories.setFrom(files(commonMainSources, jvmMainSources))
193+ classDirectories.setFrom(layout.buildDirectory.file(" classes/kotlin/jvm/main" ))
194+ executionData.setFrom(layout.buildDirectory.files(" jacoco/jvmTest.exec" ))
195+
196+ reports {
197+ xml.required = true
198+ html.required = true
199+ }
200+ }
201+
202+ jvmTest.configure {
203+ finalizedBy(jacocoReport)
204+ }
180205}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments