Skip to content

Commit

Permalink
No longer using the deprecated org.gradle.api.Project.buildDir
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemen committed Dec 19, 2023
1 parent b573d01 commit 57bc571
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ freemarkerRoot {

val compileJavacc = tasks.register<freemarker.build.CompileJavaccTask>("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(
Expand Down Expand Up @@ -346,7 +346,7 @@ tasks.withType<PublishToMavenRepository>().configureEach {
}

val distArchiveBaseName = "apache-${name}"
val distDir = buildDir.toPath().resolve("distributions")
val distDir = layout.buildDirectory.map { it.dir("distributions") }

fun registerDistSupportTasks(archiveTask: TaskProvider<Tar>) {
val signTask = tasks.register<freemarker.build.SignatureTask>("${archiveTask.name}Signature") {
Expand Down Expand Up @@ -378,7 +378,7 @@ fun registerCommonFiles(tar: Tar) {
val distBin = tasks.register<Tar>("distBin") {
compression = Compression.GZIP
archiveBaseName.set(distArchiveBaseName)
destinationDirectory.set(distDir.toFile())
destinationDirectory.set(distDir)
archiveAppendix.set("bin")

registerCommonFiles(this)
Expand All @@ -405,7 +405,7 @@ registerDistSupportTasks(distBin)
val distSrc = tasks.register<Tar>("distSrc") {
compression = Compression.GZIP
archiveBaseName.set(distArchiveBaseName)
destinationDirectory.set(distDir.toFile())
destinationDirectory.set(distDir)
archiveAppendix.set("src")

registerCommonFiles(this)
Expand Down Expand Up @@ -454,7 +454,7 @@ fun registerDistRatTask(taskName: String, excludeFile: File, srcArchiveTaskRef:
val ratInputTask = tasks.register<Sync>(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 }))
}

Expand Down

0 comments on commit 57bc571

Please sign in to comment.