Use JetBrains runtime for run tasks

allows for better runtime class redefinition

closes #10459
This commit is contained in:
Jason Penilla 2024-04-27 17:27:32 -07:00
parent d99d84a8aa
commit 83767f9544
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8
14 changed files with 22 additions and 18 deletions

View file

@ -28,10 +28,10 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..0aa34e8bb81700a3660ba89b3e2a8f53f10ca34c
index 0000000000000000000000000000000000000000..a457cf30d37037ce09fbe5d26e051b9555ce9982
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,122 @@
@@ -0,0 +1,126 @@
+import io.papermc.paperweight.util.*
+
+plugins {
@ -107,7 +107,11 @@ index 0000000000000000000000000000000000000000..0aa34e8bb81700a3660ba89b3e2a8f53
+ workingDir = rootProject.layout.projectDirectory
+ .dir(providers.gradleProperty("paper.runWorkDir").getOrElse("run"))
+ .asFile
+ javaLauncher.set(project.javaToolchains.launcherFor(project.java.toolchain))
+ javaLauncher.set(project.javaToolchains.launcherFor {
+ languageVersion.set(JavaLanguageVersion.of(21))
+ vendor.set(JvmVendorSpec.JETBRAINS)
+ })
+ jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
+
+ if (rootProject.childProjects["test-plugin"] != null) {
+ val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }

View file

@ -9,7 +9,7 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 0aa34e8bb81700a3660ba89b3e2a8f53f10ca34c..0d0e1191df8c68fc7142d3d63bd9416477811a17 100644
index a457cf30d37037ce09fbe5d26e051b9555ce9982..9ca8ddea1d53076e0f23c6e3bf3e3eca5cceb393 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,9 +8,7 @@ plugins {
@ -59,7 +59,7 @@ index 0aa34e8bb81700a3660ba89b3e2a8f53f10ca34c..0d0e1191df8c68fc7142d3d63bd94164
tasks.test {
exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class")
useJUnitPlatform()
@@ -119,4 +132,5 @@ tasks.registerRunTask("runReobf") {
@@ -123,4 +136,5 @@ tasks.registerRunTask("runReobf") {
tasks.registerRunTask("runDev") {
description = "Spin up a non-relocated Mojang-mapped test server"
classpath(sourceSets.main.map { it.runtimeClasspath })

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Test changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 0d0e1191df8c68fc7142d3d63bd9416477811a17..842a73be79b755009acd830760fe0d2b405c2a8e 100644
index 9ca8ddea1d53076e0f23c6e3bf3e3eca5cceb393..2f73e709dcde063ec7ca2181f2f2d5670fd479f5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {

View file

@ -15,7 +15,7 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine
public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
diff --git a/build.gradle.kts b/build.gradle.kts
index 842a73be79b755009acd830760fe0d2b405c2a8e..4640fc676ca3d4a9eb6276e027e086862ed655b0 100644
index 2f73e709dcde063ec7ca2181f2f2d5670fd479f5..18221614060ec945cb8b197acd276e45450f7394 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -10,6 +10,7 @@ dependencies {

View file

@ -25,7 +25,7 @@ Other changes:
Co-Authored-By: Emilia Kond <emilia@rymiel.space>
diff --git a/build.gradle.kts b/build.gradle.kts
index 4640fc676ca3d4a9eb6276e027e086862ed655b0..869df6523b3c502e0331810953cb8b3b30ae58a5 100644
index 18221614060ec945cb8b197acd276e45450f7394..f7a1c358b0caf524707dcf1346d1d5a22500ce59 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -5,9 +5,29 @@ plugins {

View file

@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing
the plugin logger.
diff --git a/build.gradle.kts b/build.gradle.kts
index 869df6523b3c502e0331810953cb8b3b30ae58a5..53b5724c16a54cb7ca0c3095724cd2a9271c98b9 100644
index f7a1c358b0caf524707dcf1346d1d5a22500ce59..1d9baec8ebafb694e259af6a24892a899791a550 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -23,7 +23,7 @@ dependencies {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
index 53b5724c16a54cb7ca0c3095724cd2a9271c98b9..1f6df49819af1c698806c1cf0d35269505881de2 100644
index 1d9baec8ebafb694e259af6a24892a899791a550..cce667165ade3e42792516a4721c74b35e7caa2c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -34,6 +34,7 @@ dependencies {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and
diff --git a/build.gradle.kts b/build.gradle.kts
index 1f6df49819af1c698806c1cf0d35269505881de2..0c2b0a06b4a4226e4cd2c3846ab8c9b4eb5d913e 100644
index cce667165ade3e42792516a4721c74b35e7caa2c..65fb16941fa7e3a9b300696fb6bd2b562bca48cd 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -45,6 +45,7 @@ dependencies {

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Plugin remapping
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
diff --git a/build.gradle.kts b/build.gradle.kts
index 0c2b0a06b4a4226e4cd2c3846ab8c9b4eb5d913e..e1588bbfdcfe601de2435b0b8f9bba3a2855411d 100644
index 65fb16941fa7e3a9b300696fb6bd2b562bca48cd..5ffd1d7c130e01a4a7516b361e48bfaf41d4f321 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -46,6 +46,7 @@ dependencies {
@ -17,7 +17,7 @@ index 0c2b0a06b4a4226e4cd2c3846ab8c9b4eb5d913e..e1588bbfdcfe601de2435b0b8f9bba3a
}
paperweight {
@@ -160,20 +161,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
@@ -164,20 +165,41 @@ val runtimeClasspathWithoutVanillaServer = configurations.runtimeClasspath.flatM
runtime.filterNot { it.asFile.absolutePath == vanilla }
}

View file

@ -6,7 +6,7 @@ Subject: [PATCH] Remap reflection calls in plugins using internals
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index e1588bbfdcfe601de2435b0b8f9bba3a2855411d..b6af3dc3f1a247c6c2ee5c040786ef21f71425ee 100644
index 5ffd1d7c130e01a4a7516b361e48bfaf41d4f321..e9498f78cb6c0973a820f093ff7a31bef44ba27f 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -47,6 +47,12 @@ dependencies {

View file

@ -10,7 +10,7 @@ Adds CommandRegisteredEvent
- Allows manipulating the CommandNode to add more children/metadata for the client
diff --git a/build.gradle.kts b/build.gradle.kts
index b6af3dc3f1a247c6c2ee5c040786ef21f71425ee..dac5aa09674a8220154403e126c275481f76ed92 100644
index e9498f78cb6c0973a820f093ff7a31bef44ba27f..db2d67c98c62aa90591fea82e8fb07270699d96c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,6 +13,7 @@ val alsoShade: Configuration by configurations.creating

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Implement Mob Goal API
diff --git a/build.gradle.kts b/build.gradle.kts
index dac5aa09674a8220154403e126c275481f76ed92..869de96d874ba52823b4b5f19398d38d46172a5b 100644
index db2d67c98c62aa90591fea82e8fb07270699d96c..7a70c2c52dec44d6b6c7acc7140b2619e56646d0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -41,6 +41,7 @@ dependencies {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Add support for Proxy Protocol
diff --git a/build.gradle.kts b/build.gradle.kts
index 869de96d874ba52823b4b5f19398d38d46172a5b..db349c954f95bb8a26e3570983d99ab197d74c4d 100644
index 7a70c2c52dec44d6b6c7acc7140b2619e56646d0..9b9e744d18cf66279f51f950b6ecce31415f9fa8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -28,6 +28,7 @@ dependencies {

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Use Velocity compression and cipher natives
diff --git a/build.gradle.kts b/build.gradle.kts
index db349c954f95bb8a26e3570983d99ab197d74c4d..898bd00a37455d6e7b5e4f52b17c127bd71f2563 100644
index 9b9e744d18cf66279f51f950b6ecce31415f9fa8..5d448d8a7cf6626a11791f30ad52baf41a099272 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -37,6 +37,11 @@ dependencies {