Skip to content

Commit b0a1a1e

Browse files
committed
Fix resolution of jmhRuntimeClasspath configurations
1 parent b67b177 commit b0a1a1e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

gradle/plugins/common/src/main/kotlin/junitbuild.java-library-conventions.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,12 @@ tasks {
255255
}
256256

257257
afterEvaluate {
258-
java {
259-
// For Groovy and Shadow plugins
260-
sourceCompatibility = extension.mainJavaVersion.get()
261-
targetCompatibility = extension.mainJavaVersion.get()
262-
}
263258
pluginManager.withPlugin("groovy") {
259+
tasks.named<GroovyCompile>("compileGroovy").configure {
260+
// Groovy compiler does not support the --release flag.
261+
sourceCompatibility = extension.mainJavaVersion.get().majorVersion
262+
targetCompatibility = extension.mainJavaVersion.get().majorVersion
263+
}
264264
tasks.withType<GroovyCompile>().named { it.startsWith("compileTest") }.configureEach {
265265
// Groovy compiler does not support the --release flag.
266266
sourceCompatibility = extension.testJavaVersion.get().majorVersion

gradle/plugins/common/src/main/kotlin/junitbuild.testing-conventions.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import com.gradle.develocity.agent.gradle.internal.test.PredictiveTestSelectionConfigurationInternal
22
import com.gradle.develocity.agent.gradle.test.PredictiveTestSelectionMode
3-
import junitbuild.extensions.trackOperationSystemAsInput
4-
import junitbuild.extensions.dependencyFromLibs
53
import junitbuild.extensions.bundleFromLibs
4+
import junitbuild.extensions.dependencyFromLibs
5+
import junitbuild.extensions.trackOperationSystemAsInput
66
import org.gradle.api.tasks.PathSensitivity.RELATIVE
77
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
88
import org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED
@@ -22,6 +22,10 @@ var javaAgentClasspath = configurations.resolvable("javaAgentClasspath") {
2222
var openTestReportingCli = configurations.dependencyScope("openTestReportingCli")
2323
var openTestReportingCliClasspath = configurations.resolvable("openTestReportingCliClasspath") {
2424
extendsFrom(openTestReportingCli.get())
25+
attributes {
26+
// Avoid using the shadowed variant of junit-platform-reporting
27+
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling::class, Bundling.EXTERNAL))
28+
}
2529
}
2630

2731
val generateOpenTestHtmlReport by tasks.registering(JavaExec::class) {

0 commit comments

Comments
 (0)