mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
Add runWorkDir
property for setting a custom run task working directory
This commit is contained in:
parent
672c5365f4
commit
75b99eb454
1 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..3e05459f27c4c5697ae65da504d67a6a
|
||||||
/.project
|
/.project
|
||||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..ccb67fe90e25010f7c8ca168d60d096ef95c4429
|
index 0000000000000000000000000000000000000000..eed3e6de0224a03b5ca9dd914b96e2fe4b94793e
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/build.gradle.kts
|
+++ b/build.gradle.kts
|
||||||
@@ -0,0 +1,121 @@
|
@@ -0,0 +1,121 @@
|
||||||
|
@ -109,9 +109,9 @@ index 0000000000000000000000000000000000000000..ccb67fe90e25010f7c8ca168d60d096e
|
||||||
+fun TaskContainer.registerRunTask(name: String, block: JavaExec.() -> Unit): TaskProvider<JavaExec> =
|
+fun TaskContainer.registerRunTask(name: String, block: JavaExec.() -> Unit): TaskProvider<JavaExec> =
|
||||||
+ register<JavaExec>(name) {
|
+ register<JavaExec>(name) {
|
||||||
+ group = "Paper"
|
+ group = "Paper"
|
||||||
+ workingDir = rootProject.projectDir.resolve("run")
|
+ workingDir = layout.projectDirectory.dir(providers.gradleProperty("runWorkDir").orElse("run")).get().asFile
|
||||||
+ doFirst {
|
+ doFirst {
|
||||||
+ if (!workingDir.exists()) workingDir.mkdir()
|
+ workingDir.mkdirs()
|
||||||
+ }
|
+ }
|
||||||
+ standardInput = System.`in`
|
+ standardInput = System.`in`
|
||||||
+ args("--nogui")
|
+ args("--nogui")
|
||||||
|
|
Loading…
Reference in a new issue