diff --git a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt index 42b8723a0a..834a432f97 100644 --- a/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt +++ b/buildSrc/src/main/kotlin/cc/tweaked/gradle/CCTweakedExtension.kt @@ -173,7 +173,7 @@ abstract class CCTweakedExtension( } fun jacoco(task: NamedDomainObjectProvider) where T : Task, T : JavaForkOptions { - val classDump = project.buildDir.resolve("jacocoClassDump/${task.name}") + val classDump = project.layout.buildDirectory.dir("jacocoClassDump/${task.name}") val reportTaskName = "jacoco${task.name.capitalized()}Report" val jacoco = project.extensions.getByType(JacocoPluginExtension::class.java) @@ -185,7 +185,7 @@ abstract class CCTweakedExtension( jacoco.applyTo(this) extensions.configure(JacocoTaskExtension::class.java) { includes = listOf("dan200.computercraft.*") - classDumpDir = classDump + classDumpDir = classDump.get().asFile // Older versions of modlauncher don't include a protection domain (and thus no code // source). Jacoco skips such classes by default, so we need to explicitly include them. diff --git a/buildSrc/src/main/kotlin/cc/tweaked/gradle/MinecraftExec.kt b/buildSrc/src/main/kotlin/cc/tweaked/gradle/MinecraftExec.kt index 0985cd0e7a..f923383c57 100644 --- a/buildSrc/src/main/kotlin/cc/tweaked/gradle/MinecraftExec.kt +++ b/buildSrc/src/main/kotlin/cc/tweaked/gradle/MinecraftExec.kt @@ -58,7 +58,7 @@ abstract class ClientJavaExec : JavaExec() { if (!clientDebug) systemProperty("cctest.client", "") if (renderdoc) environment("LD_PRELOAD", "/usr/lib/librenderdoc.so") systemProperty("cctest.gametest-report", testResults.get().asFile.absoluteFile) - workingDir(project.buildDir.resolve("gametest").resolve(name)) + workingDir(project.layout.buildDirectory.dir("gametest/$name")) } init { diff --git a/projects/core/build.gradle.kts b/projects/core/build.gradle.kts index 01996a83e9..abf7ba7c07 100644 --- a/projects/core/build.gradle.kts +++ b/projects/core/build.gradle.kts @@ -2,6 +2,8 @@ // // SPDX-License-Identifier: MPL-2.0 +import cc.tweaked.gradle.getAbsolutePath + plugins { `java-library` `java-test-fixtures` @@ -45,7 +47,7 @@ tasks.processResources { } tasks.test { - systemProperty("cct.test-files", buildDir.resolve("tmp/testFiles").absolutePath) + systemProperty("cct.test-files", layout.buildDirectory.dir("tmp/testFiles").getAbsolutePath()) } tasks.testFixturesJar { diff --git a/projects/fabric/build.gradle.kts b/projects/fabric/build.gradle.kts index 9e81e6a991..ba43ff08d8 100644 --- a/projects/fabric/build.gradle.kts +++ b/projects/fabric/build.gradle.kts @@ -169,7 +169,7 @@ loom { configureForGameTest(this) property("fabric-api.gametest") - property("fabric-api.gametest.report-file", project.buildDir.resolve("test-results/runGametest.xml").absolutePath) + property("fabric-api.gametest.report-file", layout.buildDirectory.dir("test-results/runGametest.xml").getAbsolutePath()) runDir("run/gametest") } } diff --git a/projects/forge/build.gradle.kts b/projects/forge/build.gradle.kts index ac6882a3e5..4a840b5612 100644 --- a/projects/forge/build.gradle.kts +++ b/projects/forge/build.gradle.kts @@ -185,7 +185,7 @@ val luaJavadoc by tasks.registering(Javadoc::class) { source(project(":core").sourceSets.main.get().java) source(project(":common").sourceSets.main.get().java) - setDestinationDir(buildDir.resolve("docs/luaJavadoc")) + destinationDir = layout.buildDirectory.dir("docs/luaJavadoc").get().asFile classpath = sourceSets.main.get().compileClasspath val options = options as StandardJavadocDocletOptions @@ -237,7 +237,7 @@ tasks.assemble { dependsOn("jarJar") } // Check tasks tasks.test { - systemProperty("cct.test-files", buildDir.resolve("tmp/testFiles").absolutePath) + systemProperty("cct.test-files", layout.buildDirectory.dir("tmp/testFiles").getAbsolutePath()) } val lintLua by tasks.registering(IlluaminateExec::class) { @@ -266,7 +266,7 @@ val runGametest by tasks.registering(JavaExec::class) { setRunConfig(minecraft.runs["gameTestServer"]) - systemProperty("cctest.gametest-report", project.buildDir.resolve("test-results/$name.xml").absolutePath) + systemProperty("cctest.gametest-report", layout.buildDirectory.dir("test-results/$name.xml").getAbsolutePath()) } cct.jacoco(runGametest) tasks.check { dependsOn(runGametest) }