diff --git a/build-logic/settings.gradle b/build-logic/settings.gradle index c3ff77d254..8303208fd4 100644 --- a/build-logic/settings.gradle +++ b/build-logic/settings.gradle @@ -5,6 +5,7 @@ pluginManagement { } } +rootProject.name = "build-logic" rootProject.buildFileName = 'build-logic.gradle' dependencyResolutionManagement { diff --git a/build.gradle b/build.gradle index ffb1911504..1582dfd9f5 100644 --- a/build.gradle +++ b/build.gradle @@ -223,7 +223,7 @@ tasks.register("collectTestXml") { doFirst { - def target = file("$buildDir/collected-test-results") + def target = layout.buildDirectory.dir("collected-test-results").get().asFile target.mkdirs() reportingProjects.each { rp -> rp.tasks.withType(Test).each { testTask -> @@ -255,7 +255,7 @@ tasks.register("codeCoverageReport", JacocoReport) { reports { html.required = true xml.required = true - xml.outputLocation = file("${buildDir}/reports/jacoco/report.xml") // report must be here for codecov to pick it up + xml.outputLocation = layout.buildDirectory.file("reports/jacoco/report.xml") // report must be here for codecov to pick it up csv.required = false } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 49d4636dbe..a323bcd554 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,14 +7,14 @@ jacoco = '0.8.12' junit = '5.11.2' asm = '9.7.1' mockito4 = '4.11.0' -mockito5 = '5.14.1' +mockito5 = '5.14.2' [libraries] -jetbrains-annotations = "org.jetbrains:annotations:26.0.0" +jetbrains-annotations = "org.jetbrains:annotations:26.0.1" asciidoctorj = { module = "org.asciidoctor:asciidoctorj", version.ref = "asciidoctorj" } asm = { module = "org.ow2.asm:asm", version.ref = "asm" } asmUtil = { module = "org.ow2.asm:asm-util", version.ref = "asm" } -bytebuddy = "net.bytebuddy:byte-buddy:1.15.4" +bytebuddy = "net.bytebuddy:byte-buddy:1.15.5" cglib = "cglib:cglib-nodep:3.3.0" geantyref = "io.leangen.geantyref:geantyref:1.3.16" h2database = "com.h2database:h2:2.2.224" diff --git a/spock-core/core.gradle b/spock-core/core.gradle index 01e97b8379..7db47aa758 100644 --- a/spock-core/core.gradle +++ b/spock-core/core.gradle @@ -95,10 +95,10 @@ tasks.named("processResources") { tasks.register("coreConsole", JavaExec) { description = 'Start a groovy Console with Spock Core Classpath, useful for AST-Inspection' - main = variant == 2.5 ? "groovy.ui.Console" : "groovy.console.ui.Console" + mainClass = variant == 2.5 ? "groovy.ui.Console" : "groovy.console.ui.Console" classpath(sourceSets.named("main").map {it.runtimeClasspath }, configurations.named("coreConsoleRuntime")) workingDir = file('build/console') - ignoreExitValue = true + ignoreExitValue true args file('CoreConsole.groovy').absolutePath doFirst { workingDir.mkdirs() @@ -109,7 +109,7 @@ tasks.register("coreConsole", JavaExec) { // task writes out the properties necessary for it to verify the OSGi // metadata. def osgiProperties = tasks.register('osgiProperties', WriteProperties) { - outputFile = layout.getBuildDirectory().file("verifyOSGiProperties.bndrun") + destinationFile = layout.getBuildDirectory().file("verifyOSGiProperties.bndrun") property('-standalone', true) property('-runee', "JavaSE-${javaVersion < 9 ? '1.' + javaVersion : javaVersion}") property('-runrequires', "osgi.identity;filter:='(osgi.identity=${project.name})'") diff --git a/spock-specs/mock-integration/mock-integration.gradle b/spock-specs/mock-integration/mock-integration.gradle index 11045f4dc1..00f1066784 100644 --- a/spock-specs/mock-integration/mock-integration.gradle +++ b/spock-specs/mock-integration/mock-integration.gradle @@ -57,6 +57,8 @@ def configureTaskFilters = { String key, Test t -> codeGenerationLibraries.each { key, config -> tasks.register("test${key.capitalize()}WithoutObjenesis", Test) { systemProperty("org.spockframework.mock.testType", "${key.toLowerCase()} - objenesis") + testClassesDirs = testing.suites.test.sources.output.classesDirs + classpath = testing.suites.test.sources.runtimeClasspath classpath += config configureTaskFilters(key, it) @@ -64,6 +66,8 @@ codeGenerationLibraries.each { key, config -> tasks.register("test${key.capitalize()}WithObjenesis", Test) { systemProperty("org.spockframework.mock.testType", "${key.toLowerCase()} + objenesis") + testClassesDirs = testing.suites.test.sources.output.classesDirs + classpath = testing.suites.test.sources.runtimeClasspath classpath += config classpath += configurations.objenesis diff --git a/spock-specs/specs.gradle b/spock-specs/specs.gradle index 898fe4ae04..0111b2fc31 100644 --- a/spock-specs/specs.gradle +++ b/spock-specs/specs.gradle @@ -89,7 +89,7 @@ tasks.named("test", Test) { } tasks.register("groovyConsole", JavaExec) { - main = variant == 2.5 ? "groovy.ui.Console" : "groovy.console.ui.Console" + mainClass = variant == 2.5 ? "groovy.ui.Console" : "groovy.console.ui.Console" classpath(sourceSets.named("test").map {it.runtimeClasspath }, configurations.named("groovyConsole")) } diff --git a/spock-testkit/testkit.gradle b/spock-testkit/testkit.gradle index c1f34e97c2..20aaa7d3ae 100644 --- a/spock-testkit/testkit.gradle +++ b/spock-testkit/testkit.gradle @@ -34,10 +34,10 @@ tasks.named("test", Test) { tasks.register("consoleLauncherTest", JavaExec) { dependsOn(testClasses) - def reportsDir = file("$buildDir/test-results") + def reportsDir = layout.buildDirectory.dir("test-results") outputs.dir(reportsDir) classpath(sourceSets.named("test").map { it.runtimeClasspath }) - main = "org.junit.platform.console.ConsoleLauncher" + mainClass = "org.junit.platform.console.ConsoleLauncher" // jvmArgs "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" // args("--select-class", "spock.testkit.testsources.ExampleTestCase") args("--select-class", "spock.testkit.testsources.UnrollTestCase")