From 9a23891fe54657a37bb78c6ded15f3c71995c359 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:09:12 -0800 Subject: [PATCH] Update runServer gradle properties --- patches/server/Setup-Gradle-project.patch | 22 +++++++++++++++------- settings.gradle.kts | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 5014753f55..f3be25511f 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -130,29 +130,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +} + +fun TaskContainer.registerRunTask( -+ name: String, block: JavaExec.() -> Unit ++ name: String, ++ block: JavaExec.() -> Unit +): TaskProvider = register(name) { + group = "paper" + standardInput = System.`in` -+ workingDir = rootProject.layout.projectDirectory.dir( -+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run") -+ ).get().asFile ++ workingDir = rootProject.layout.projectDirectory ++ .dir(providers.gradleProperty("paper.runWorkDir").forUseAtConfigurationTime().getOrElse("run")) ++ .asFile ++ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project)) + + if (rootProject.childProjects["test-plugin"] != null) { + val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile } + inputs.file(testPluginJar) -+ // args("-add-plugin=${testPluginJar.get().asFile.absolutePath}") // todo - uncomment ++ args("-add-plugin=${testPluginJar.get().asFile.absolutePath}") + } + + args("--nogui") + systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true) -+ if (project.hasProperty("disableWatchdog")) { ++ if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") { + systemProperty("disable.watchdog", true) + } ++ ++ val memoryGb = providers.gradleProperty("paper.runMemoryGb").forUseAtConfigurationTime().getOrElse("2") ++ val modifiedJvmArgs = jvmArgs ?: arrayListOf() ++ modifiedJvmArgs.addAll(listOf("-Xms${memoryGb}G", "-Xmx${memoryGb}G")) ++ jvmArgs = modifiedJvmArgs ++ + doFirst { + workingDir.mkdirs() + } -+ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project)) ++ + block(this) +} + diff --git a/settings.gradle.kts b/settings.gradle.kts index 9afad2ea0c..de13572ae2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ rootProject.name = "Paper" include( "Paper-API", "Paper-Server", - "Paper-MojangAPI", + "Paper-MojangAPI", ) val testPlugin = file("test-plugin.settings.gradle.kts")