From 57bc571d5736101b124cd30f562150685f8110c0 Mon Sep 17 00:00:00 2001 From: Attila Kelemen Date: Tue, 19 Dec 2023 17:54:31 +0100 Subject: [PATCH] No longer using the deprecated org.gradle.api.Project.buildDir --- build.gradle.kts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1dff55e18..a23375d4d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,7 +51,7 @@ freemarkerRoot { val compileJavacc = tasks.register("compileJavacc") { sourceDirectory.set(file("freemarker-core/src/main/javacc")) - destinationDirectory.set(buildDir.toPath().resolve("generated").resolve("javacc").toFile()) + destinationDirectory.set(project.layout.buildDirectory.map { it.dir("generated").dir("javacc") }) javaccVersion.set("7.0.12") fileNameOverrides.addAll( @@ -346,7 +346,7 @@ tasks.withType().configureEach { } val distArchiveBaseName = "apache-${name}" -val distDir = buildDir.toPath().resolve("distributions") +val distDir = layout.buildDirectory.map { it.dir("distributions") } fun registerDistSupportTasks(archiveTask: TaskProvider) { val signTask = tasks.register("${archiveTask.name}Signature") { @@ -378,7 +378,7 @@ fun registerCommonFiles(tar: Tar) { val distBin = tasks.register("distBin") { compression = Compression.GZIP archiveBaseName.set(distArchiveBaseName) - destinationDirectory.set(distDir.toFile()) + destinationDirectory.set(distDir) archiveAppendix.set("bin") registerCommonFiles(this) @@ -405,7 +405,7 @@ registerDistSupportTasks(distBin) val distSrc = tasks.register("distSrc") { compression = Compression.GZIP archiveBaseName.set(distArchiveBaseName) - destinationDirectory.set(distDir.toFile()) + destinationDirectory.set(distDir) archiveAppendix.set("src") registerCommonFiles(this) @@ -454,7 +454,7 @@ fun registerDistRatTask(taskName: String, excludeFile: File, srcArchiveTaskRef: val ratInputTask = tasks.register(inputTaskName) { dependsOn(srcArchiveTaskRef) - destinationDir = buildDir.toPath().resolve("rat-prep").resolve(taskName).toFile() + destinationDir = layout.buildDirectory.get().asFile.resolve("rat-prep").resolve(taskName) from(tarTree(srcArchiveTaskRef.flatMap { it.archiveFile })) }