mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Update runServer gradle properties
This commit is contained in:
parent
2b17f5cc15
commit
9a23891fe5
@ -130,29 +130,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+fun TaskContainer.registerRunTask(
|
+fun TaskContainer.registerRunTask(
|
||||||
+ name: String, block: JavaExec.() -> Unit
|
+ name: String,
|
||||||
|
+ block: JavaExec.() -> Unit
|
||||||
+): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
+): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||||
+ group = "paper"
|
+ group = "paper"
|
||||||
+ standardInput = System.`in`
|
+ standardInput = System.`in`
|
||||||
+ workingDir = rootProject.layout.projectDirectory.dir(
|
+ workingDir = rootProject.layout.projectDirectory
|
||||||
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
+ .dir(providers.gradleProperty("paper.runWorkDir").forUseAtConfigurationTime().getOrElse("run"))
|
||||||
+ ).get().asFile
|
+ .asFile
|
||||||
|
+ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project))
|
||||||
+
|
+
|
||||||
+ if (rootProject.childProjects["test-plugin"] != null) {
|
+ if (rootProject.childProjects["test-plugin"] != null) {
|
||||||
+ val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
|
+ val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }
|
||||||
+ inputs.file(testPluginJar)
|
+ inputs.file(testPluginJar)
|
||||||
+ // args("-add-plugin=${testPluginJar.get().asFile.absolutePath}") // todo - uncomment
|
+ args("-add-plugin=${testPluginJar.get().asFile.absolutePath}")
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ args("--nogui")
|
+ args("--nogui")
|
||||||
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
||||||
+ if (project.hasProperty("disableWatchdog")) {
|
+ if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") {
|
||||||
+ systemProperty("disable.watchdog", 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 {
|
+ doFirst {
|
||||||
+ workingDir.mkdirs()
|
+ workingDir.mkdirs()
|
||||||
+ }
|
+ }
|
||||||
+ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project))
|
+
|
||||||
+ block(this)
|
+ block(this)
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
Loading…
Reference in New Issue
Block a user