mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 12:12:08 -07:00
Update runDev task for Gradle 7.1 deprecations
also no longer disable watchdog by default, instead require `disableWatchdog` Gradle property to be set
This commit is contained in:
@@ -25,10 +25,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer
|
||||
+import io.papermc.paperweight.util.Git
|
||||
+import io.papermc.paperweight.util.path
|
||||
+import org.gradle.api.file.FileTreeElement
|
||||
+import shadow.org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.PLUGIN_CACHE_FILE
|
||||
+import java.util.Date
|
||||
+import java.text.SimpleDateFormat
|
||||
+import java.util.Date
|
||||
+
|
||||
+plugins {
|
||||
+ java
|
||||
@@ -114,20 +113,24 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
|
||||
+}
|
||||
+
|
||||
+fun TaskContainer.registerRunTask(name: String, block: JavaExec.() -> Unit): TaskProvider<JavaExec> =
|
||||
+ register<JavaExec>(name) {
|
||||
+ group = "Paper"
|
||||
+ workingDir = rootProject.layout.projectDirectory.dir(
|
||||
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
||||
+ ).get().asFile
|
||||
+ doFirst {
|
||||
+ workingDir.mkdirs()
|
||||
+ }
|
||||
+ standardInput = System.`in`
|
||||
+ args("--nogui")
|
||||
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
||||
+ block(this)
|
||||
+fun TaskContainer.registerRunTask(
|
||||
+ name: String, block: JavaExec.() -> Unit
|
||||
+): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
+ group = "paper"
|
||||
+ standardInput = System.`in`
|
||||
+ workingDir = rootProject.layout.projectDirectory.dir(
|
||||
+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run")
|
||||
+ ).get().asFile
|
||||
+ args("--nogui")
|
||||
+ systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true)
|
||||
+ if (project.hasProperty("disableWatchdog")) {
|
||||
+ systemProperty("disable.watchdog", true)
|
||||
+ }
|
||||
+ doFirst {
|
||||
+ workingDir.mkdirs()
|
||||
+ }
|
||||
+ block(this)
|
||||
+}
|
||||
+
|
||||
+tasks.registerRunTask("runShadow") {
|
||||
+ description = "Spin up a test server from the shadowJar archiveFile"
|
||||
@@ -141,10 +144,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+tasks.registerRunTask("runDev") {
|
||||
+ description = "Spin up a non-shaded non-remapped test server"
|
||||
+ classpath = project.convention.getPlugin(JavaPluginConvention::class.java)
|
||||
+ .sourceSets.getByName("main").runtimeClasspath
|
||||
+ main = "org.bukkit.craftbukkit.Main"
|
||||
+ systemProperty("disable.watchdog", true)
|
||||
+ classpath = java.sourceSets.main.get().runtimeClasspath
|
||||
+ mainClass.set("org.bukkit.craftbukkit.Main")
|
||||
+}
|
||||
+
|
||||
+class ModifiedLog4j2PluginsCacheFileTransformer : Transformer by Log4j2PluginsCacheFileTransformer() {
|
||||
|
Submodule work/Bukkit updated: e9ce88b99c...ebb0e28d11
Submodule work/CraftBukkit updated: d7ef1e91fa...f992ce6097
Reference in New Issue
Block a user