From 75b99eb454494983ff7c0b91dc58de82eef35d4d Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 12 Jun 2021 19:18:24 -0700 Subject: [PATCH] Add `runWorkDir` property for setting a custom run task working directory --- patches/server/0001-Setup-Gradle-project.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index cd9ca8645..161db84a2 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -17,7 +17,7 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a /.project diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..ccb67fe90e25010f7c8ca168d60d096ef95c4429 +index 0000000000000000000000000000000000000000..eed3e6de0224a03b5ca9dd914b96e2fe4b94793e --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,121 @@ @@ -109,9 +109,9 @@ index 0000000000000000000000000000000000000000..ccb67fe90e25010f7c8ca168d60d096e +fun TaskContainer.registerRunTask(name: String, block: JavaExec.() -> Unit): TaskProvider = + register(name) { + group = "Paper" -+ workingDir = rootProject.projectDir.resolve("run") ++ workingDir = layout.projectDirectory.dir(providers.gradleProperty("runWorkDir").orElse("run")).get().asFile + doFirst { -+ if (!workingDir.exists()) workingDir.mkdir() ++ workingDir.mkdirs() + } + standardInput = System.`in` + args("--nogui")