From c6b3af023f1b6033f9f7bafe8149e30771b5c629 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Thu, 11 Jul 2024 04:59:35 +0200 Subject: [PATCH] Use copy task instead of symlinks for resources --- base/build.gradle | 50 +++++++++++++++-------- base/src/main/resources/.gitignore | 1 + base/src/main/resources/gradle.properties | 1 - 3 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 base/src/main/resources/.gitignore delete mode 120000 base/src/main/resources/gradle.properties diff --git a/base/build.gradle b/base/build.gradle index 8e5b9a0..05fc54e 100644 --- a/base/build.gradle +++ b/base/build.gradle @@ -17,6 +17,10 @@ * along with this program. If not, see . */ +import java.nio.file.Files + + + // Plugins plugins { id("java") @@ -54,6 +58,36 @@ dependencies { testImplementation("org.jooq:joor:${dependencyJoor}") } +// Fix delombok task +delombok.doFirst { + File target = file("${project.projectDir}/src/main/module-info.java") + File source = file("${project.projectDir}/src/main/java/module-info.java") + + target.delete() + source.renameTo(target) +} +delombok.doLast { + File target = file("${project.projectDir}/src/main/java/module-info.java") + File source = file("${project.projectDir}/src/main/module-info.java") + + target.delete() + source.renameTo(target) +} + +// Copy gradle.properties file +// for inclusion in final build +tasks.register("copyGradleProperties") { + doFirst { + File target = file("${project.projectDir}/src/main/resources/gradle.properties") + File source = file(project(":").projectDir.getPath() + "/gradle.properties") + target.delete() + Files.copy(source.toPath(), target.toPath()) + } + + outputs.upToDateWhen({ false }) // Force task execution +} +processResources.dependsOn(copyGradleProperties) + // Git properties configuration // Allows us to embed git commit information in the engine build gitProperties { @@ -79,22 +113,6 @@ tasks.register("writeGitProperties") { // This task's only purpose is to copy t generateGitProperties.outputs.upToDateWhen({ false }) // Force task execution processResources.dependsOn(writeGitProperties) // Ensure git.properties file is present -// Fix delombok task -delombok.doFirst { - File target = file("${project.projectDir}/src/main/module-info.java") - File source = file("${project.projectDir}/src/main/java/module-info.java") - - target.delete() - source.renameTo(target) -} -delombok.doLast { - File target = file("${project.projectDir}/src/main/java/module-info.java") - File source = file("${project.projectDir}/src/main/module-info.java") - - target.delete() - source.renameTo(target) -} - // Javadoc configuration javadoc { outputs.upToDateWhen { false } // Force task execution diff --git a/base/src/main/resources/.gitignore b/base/src/main/resources/.gitignore new file mode 100644 index 0000000..0567e20 --- /dev/null +++ b/base/src/main/resources/.gitignore @@ -0,0 +1 @@ +*.properties diff --git a/base/src/main/resources/gradle.properties b/base/src/main/resources/gradle.properties deleted file mode 120000 index bc5f9c2..0000000 --- a/base/src/main/resources/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -../../../../gradle.properties \ No newline at end of file