mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Add runWorkDir
property for setting a custom run task working directory
This commit is contained in:
parent
3a7b3b35c3
commit
ec859f1f2f
1 changed files with 2 additions and 2 deletions
|
@ -109,9 +109,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+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