Skip to content

Commit

Permalink
Merge branch 'master' into bytebuddy-local-mock-detection
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard84 authored Oct 18, 2024
2 parents 0de3403 + f214a8a commit 777420c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions build-logic/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pluginManagement {
}
}

rootProject.name = "build-logic"
rootProject.buildFileName = 'build-logic.gradle'

dependencyResolutionManagement {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down Expand Up @@ -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
}
}
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions spock-core/core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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})'")
Expand Down
4 changes: 4 additions & 0 deletions spock-specs/mock-integration/mock-integration.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,17 @@ 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)
}

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

Expand Down
2 changes: 1 addition & 1 deletion spock-specs/specs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

Expand Down
4 changes: 2 additions & 2 deletions spock-testkit/testkit.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 777420c

Please sign in to comment.