mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01: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:
parent
d6c75ac925
commit
942c015158
3 changed files with 22 additions and 21 deletions
|
@ -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() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e9ce88b99c08332877866313784cd84e9d9b54fb
|
||||
Subproject commit ebb0e28d11747aa0bb4bb39fad8979ccfaa925b6
|
|
@ -1 +1 @@
|
|||
Subproject commit d7ef1e91fa6431aa649b4bfcdabdbbef8ba41267
|
||||
Subproject commit f992ce6097f846ed5967fc797d98ae3e84ef1b10
|
Loading…
Add table
Reference in a new issue