Skip to content

Commit

Permalink
Fix trivial Gradle deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
beatbrot committed Oct 12, 2024
1 parent 2b87cff commit 2ff1692
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
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 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
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 2ff1692

Please sign in to comment.