Use forUseAtConfigurationTime() for run directory property

This commit is contained in:
Jason Penilla 2021-06-12 20:21:59 -07:00
parent 152994d950
commit 06f41a4885
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8

View file

@ -17,10 +17,10 @@ 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..492e3b592d17bd3d5fb4a36ff123f2bd2d13051e index 0000000000000000000000000000000000000000..29564703bd1502269c04cd5fb3070b687ca51af5
--- /dev/null --- /dev/null
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -0,0 +1,119 @@ @@ -0,0 +1,121 @@
+import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
+import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
+import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
@ -107,7 +107,9 @@ index 0000000000000000000000000000000000000000..492e3b592d17bd3d5fb4a36ff123f2bd
+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 = layout.projectDirectory.dir(providers.gradleProperty("runWorkDir").orElse("run")).get().asFile + workingDir = layout.projectDirectory.dir(
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
+ ).get().asFile
+ doFirst { + doFirst {
+ workingDir.mkdirs() + workingDir.mkdirs()
+ } + }