Skip to content

Commit cb8ca44

Browse files
committed
Fix build when JaCoCo is enabled
1 parent ea6ddf8 commit cb8ca44

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

buildSrc/src/main/kotlin/jacoco-aggregation-conventions.gradle.kts

-13
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import org.gradle.api.attributes.LibraryElements
3-
import org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE
41
import org.gradle.api.attributes.TestSuiteType
52
import org.gradle.kotlin.dsl.invoke
63
import org.gradle.kotlin.dsl.`jacoco-report-aggregation`
7-
import org.gradle.kotlin.dsl.named
84
import org.gradle.testing.jacoco.plugins.JacocoCoverageReport
9-
import org.junit.gradle.jacoco.JacocoConventions.COVERAGE_CLASSES
105

116
plugins {
127
id("jacoco-conventions")
138
`jacoco-report-aggregation`
149
}
1510

16-
configurations {
17-
allCodeCoverageReportClassDirectories {
18-
attributes {
19-
attribute(LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements::class, COVERAGE_CLASSES))
20-
}
21-
}
22-
}
23-
2411
reporting {
2512
reports {
2613
create<JacocoCoverageReport>("jacocoRootReport") {

buildSrc/src/main/kotlin/jacoco-java-conventions.gradle.kts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
1+
import org.gradle.api.attributes.LibraryElements.CLASSES
22
import org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE
3-
import org.junit.gradle.jacoco.JacocoConventions.COVERAGE_CLASSES
43

54
plugins {
65
java
@@ -27,6 +26,6 @@ configurations.create("codeCoverageReportClasses") {
2726
isCanBeResolved = false
2827
isCanBeConsumed = true
2928
isTransitive = false
30-
attributes.attribute(LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements::class, COVERAGE_CLASSES))
29+
attributes.attribute(LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements::class, CLASSES))
3130
outgoing.artifact(codeCoverageClassesJar)
3231
}

buildSrc/src/main/kotlin/org/junit/gradle/jacoco/JacocoConventions.kt

-5
This file was deleted.

0 commit comments

Comments
 (0)