-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42a1901
commit 52dcbfb
Showing
21 changed files
with
152 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,27 +7,69 @@ Subject: [PATCH] Test changes | |
- Ignore package-private methods for nullability annotations | ||
- Add excludes for classes which don't pass | ||
- Disable stupid BukkitMirrorTest | ||
- configure mockito agent to address changes in newer java versions see https://openjdk.org/jeps/451 | ||
|
||
Co-authored-by: Riley Park <[email protected]> | ||
Co-authored-by: Jake Potrebic <[email protected]> | ||
Co-authored-by: Yannick Lamprecht <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 0b837b485bec96fa37ed65c18df97e55cecd0e9d..c8a8903d1b0c9822743549ecb8e4fdc7d0fd07c1 100644 | ||
index 0b837b485bec96fa37ed65c18df97e55cecd0e9d..ffa4851c98d30a2ac7d3c5bfa52a1033c682db0d 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -107,6 +107,12 @@ tasks.test { | ||
useJUnitPlatform() | ||
@@ -1,3 +1,5 @@ | ||
+import org.gradle.kotlin.dsl.newInstance // Paper - configure mockito agent that is needed in newer java versions | ||
+ | ||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
@@ -11,6 +13,19 @@ java { | ||
val annotationsVersion = "24.1.0" | ||
val bungeeCordChatVersion = "1.20-R0.2" | ||
|
||
+// Paper start - configure mockito agent that is needed in newer java versions | ||
+val mockitoAgent = configurations.register("mockitoAgent") | ||
+abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
+ @get:InputFiles | ||
+ @get:CompileClasspath | ||
+ abstract val fileCollection: ConfigurableFileCollection | ||
+ | ||
+ override fun asArguments(): Iterable<String> { | ||
+ return listOf("-javaagent:" + fileCollection.files.single().absolutePath) | ||
+ } | ||
+} | ||
+// Paper end - configure mockito agent that is needed in newer java versions | ||
+ | ||
dependencies { | ||
// api dependencies are listed transitively to API consumers | ||
api("com.google.guava:guava:32.1.2-jre") | ||
@@ -44,6 +59,7 @@ dependencies { | ||
testImplementation("org.hamcrest:hamcrest:2.2") | ||
testImplementation("org.mockito:mockito-core:5.14.1") | ||
testImplementation("org.ow2.asm:asm-tree:9.7.1") | ||
+ mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions | ||
} | ||
|
||
configure<PublishingExtension> { | ||
@@ -105,7 +121,18 @@ tasks.withType<Javadoc> { | ||
|
||
tasks.test { | ||
useJUnitPlatform() | ||
+ // Paper start - configure mockito agent that is needed in newer java versions | ||
+ val provider = objects.newInstance<MockitoAgentProvider>() | ||
+ provider.fileCollection.from(mockitoAgent) | ||
+ jvmArgumentProviders.add(provider) | ||
+ // Paper end - configure mockito agent that is needed in newer java versions | ||
+} | ||
+ | ||
+// Paper start - compile tests with -parameters for better junit parameterized test names | ||
+tasks.compileTestJava { | ||
+ options.compilerArgs.add("-parameters") | ||
+} | ||
} | ||
+// Paper end | ||
+ | ||
// Paper start | ||
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) { | ||
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;") | ||
diff --git a/src/test/java/io/papermc/paper/testing/EmptyTag.java b/src/test/java/io/papermc/paper/testing/EmptyTag.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f559ebc18 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,10 @@ Co-authored-by: Jake Potrebic <[email protected]> | |
Co-authored-by: Yannick Lamprecht <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 4b6c5d1ae45d93d88adb7035eb19935361c06178..cce9caa52c9a2208acccbd25fa88c0de066f23a4 100644 | ||
index 049852eb914e0fa9482b50f0e6a272b244532a46..344f1850781f9fb4a237ebd0d5a21ab006756db3 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -11,12 +11,28 @@ java { | ||
@@ -13,6 +13,18 @@ java { | ||
|
||
val annotationsVersion = "24.1.0" | ||
val bungeeCordChatVersion = "1.20-R0.2" | ||
|
@@ -28,7 +28,9 @@ index 4b6c5d1ae45d93d88adb7035eb19935361c06178..cce9caa52c9a2208acccbd25fa88c0de | |
+ extendsFrom(apiAndDocs) | ||
+} | ||
|
||
dependencies { | ||
// Paper start - configure mockito agent that is needed in newer java versions | ||
val mockitoAgent = configurations.register("mockitoAgent") | ||
@@ -31,7 +43,11 @@ dependencies { | ||
// api dependencies are listed transitively to API consumers | ||
api("com.google.guava:guava:32.1.2-jre") | ||
api("com.google.code.gson:gson:2.10.1") | ||
|
@@ -41,7 +43,7 @@ index 4b6c5d1ae45d93d88adb7035eb19935361c06178..cce9caa52c9a2208acccbd25fa88c0de | |
api("org.yaml:snakeyaml:2.2") | ||
api("org.joml:joml:1.10.5") | ||
// Paper start | ||
@@ -24,6 +40,13 @@ dependencies { | ||
@@ -39,6 +55,13 @@ dependencies { | ||
isTransitive = false // includes junit | ||
} | ||
api("it.unimi.dsi:fastutil:8.5.6") | ||
|
@@ -55,7 +57,7 @@ index 4b6c5d1ae45d93d88adb7035eb19935361c06178..cce9caa52c9a2208acccbd25fa88c0de | |
// Paper end | ||
|
||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") | ||
@@ -100,15 +123,32 @@ tasks.withType<Javadoc> { | ||
@@ -116,15 +139,32 @@ tasks.withType<Javadoc> { | ||
"https://guava.dev/releases/32.1.2-jre/api/docs/", | ||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/", | ||
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,18 +6,18 @@ Subject: [PATCH] Brigadier based command API | |
Co-authored-by: Jake Potrebic <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index 6c8464d9e862b1b4dbf7a77e25446aa870803dae..254fd96d3950b4494c7e43547b00b5175ee53c93 100644 | ||
index 9384972f171c22ee0b1ba207cd3c93d4eb9c71fe..4084e46b96224c5618c90a03037653b26fb82d54 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -27,6 +27,7 @@ configurations.api { | ||
} | ||
@@ -42,6 +42,7 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
// Paper end - configure mockito agent that is needed in newer java versions | ||
|
||
dependencies { | ||
+ api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api | ||
// api dependencies are listed transitively to API consumers | ||
api("com.google.guava:guava:32.1.2-jre") | ||
api("com.google.code.gson:gson:2.10.1") | ||
@@ -93,9 +94,33 @@ sourceSets { | ||
@@ -109,9 +110,33 @@ sourceSets { | ||
} | ||
} | ||
// Paper end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,45 @@ From: Jake Potrebic <[email protected]> | |
Date: Mon, 13 Feb 2023 14:14:56 -0800 | ||
Subject: [PATCH] Test changes | ||
|
||
- configure mockito agent to address changes in newer java versions see https://openjdk.org/jeps/451 | ||
|
||
Co-authored-by: yannnicklamprecht <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index d4a5229b4df544ff60cdaee80c8ae301faf2a235..41b000aaa71dca3fb392ae657be16e05bd37a178 100644 | ||
index d4a5229b4df544ff60cdaee80c8ae301faf2a235..4c8452ad8d39ca606f71205d628c5c6941ca93f9 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -23,6 +23,7 @@ dependencies { | ||
@@ -5,6 +5,19 @@ plugins { | ||
`maven-publish` | ||
} | ||
|
||
+// Paper start - configure mockito agent that is needed in newer java versions | ||
+val mockitoAgent = configurations.register("mockitoAgent") | ||
+abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
+ @get:InputFiles | ||
+ @get:CompileClasspath | ||
+ abstract val fileCollection: ConfigurableFileCollection | ||
+ | ||
+ override fun asArguments(): Iterable<String> { | ||
+ return listOf("-javaagent:" + fileCollection.files.single().absolutePath) | ||
+ } | ||
+} | ||
+// Paper end - configure mockito agent that is needed in newer java versions | ||
+ | ||
dependencies { | ||
implementation(project(":paper-api")) | ||
implementation("jline:jline:2.12.1") | ||
@@ -22,7 +35,9 @@ dependencies { | ||
testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0") | ||
testImplementation("org.hamcrest:hamcrest:2.2") | ||
testImplementation("org.mockito:mockito-core:5.14.1") | ||
+ mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions | ||
testImplementation("org.ow2.asm:asm-tree:9.7.1") | ||
+ testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest | ||
} | ||
|
||
paperweight { | ||
@@ -56,6 +57,12 @@ tasks.jar { | ||
@@ -56,6 +71,12 @@ tasks.jar { | ||
} | ||
} | ||
|
||
|
@@ -30,6 +54,18 @@ index d4a5229b4df544ff60cdaee80c8ae301faf2a235..41b000aaa71dca3fb392ae657be16e05 | |
publishing { | ||
publications.create<MavenPublication>("maven") { | ||
} | ||
@@ -79,6 +100,11 @@ tasks.test { | ||
forkEvery = 1 | ||
excludeTags("Slow") | ||
} | ||
+ // Paper start - configure mockito agent that is needed in newer java versions | ||
+ val provider = objects.newInstance<MockitoAgentProvider>() | ||
+ provider.fileCollection.from(mockitoAgent) | ||
+ jvmArgumentProviders.add(provider) | ||
+ // Paper end - configure mockito agent that is needed in newer java versions | ||
} | ||
|
||
fun TaskContainer.registerRunTask( | ||
diff --git a/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java b/src/test/java/io/papermc/paper/registry/RegistryKeyTest.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..d8857a05858585113bc7efde3416748effb53d01 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,10 @@ Other changes: | |
Co-Authored-By: Emilia Kond <[email protected]> | ||
|
||
diff --git a/build.gradle.kts b/build.gradle.kts | ||
index da6b4787fa787e098e4031790e955ce616593ee9..02a3dd42d82df410b6a6d22c0350fa3e44ccf70f 100644 | ||
index 5092490e3fe34c980a0fd6938766eff87c600fdf..be0b76e89c231599e327e91c65906e88321abc3d 100644 | ||
--- a/build.gradle.kts | ||
+++ b/build.gradle.kts | ||
@@ -5,9 +5,29 @@ plugins { | ||
@@ -5,6 +5,12 @@ plugins { | ||
`maven-publish` | ||
} | ||
|
||
|
@@ -38,6 +38,11 @@ index da6b4787fa787e098e4031790e955ce616593ee9..02a3dd42d82df410b6a6d22c0350fa3e | |
+} | ||
+val alsoShade: Configuration by configurations.creating | ||
+ | ||
// Paper start - configure mockito agent that is needed in newer java versions | ||
val mockitoAgent = configurations.register("mockitoAgent") | ||
abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
@@ -20,7 +26,21 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider { | ||
|
||
dependencies { | ||
implementation(project(":paper-api")) | ||
- implementation("jline:jline:2.12.1") | ||
|
@@ -59,7 +64,7 @@ index da6b4787fa787e098e4031790e955ce616593ee9..02a3dd42d82df410b6a6d22c0350fa3e | |
implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion | ||
implementation("org.ow2.asm:asm-commons:9.7.1") | ||
implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files | ||
@@ -79,6 +99,19 @@ tasks.check { | ||
@@ -93,6 +113,19 @@ tasks.check { | ||
dependsOn(scanJar) | ||
} | ||
// Paper end | ||
|
@@ -382,7 +387,7 @@ index 3d92c61f7781221cfdc0324d11bd0088954e4a68..84a2c6c397604279ba821286f5c3c855 | |
if (!SwingUtilities.isEventDispatchThread()) { | ||
SwingUtilities.invokeLater(() -> { | ||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java | ||
index a70e0ecedc7b70031334bc7fee981bd790ce26a4..56f046bac04205a813441907058c4ce21982d927 100644 | ||
index 1333daa8666fe2ec4033a2f57ba6b716fcdd5343..8daa027a94602d7d556cf4fbfc8fcd97caf6bd98 100644 | ||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java | ||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java | ||
@@ -162,8 +162,7 @@ public abstract class PlayerList { | ||
|
@@ -396,7 +401,7 @@ index a70e0ecedc7b70031334bc7fee981bd790ce26a4..56f046bac04205a813441907058c4ce2 | |
|
||
this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); | ||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
index 16a9142bdbbfbbbb69d1486bd119dc610094484b..2affb23b83e4368a94345b36410f23139f5d36c8 100644 | ||
index c3fc8b1abe843a19347509947f4b864c1b417800..e497da2dba83779c4ad1c45cea133bddadf61446 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java | ||
@@ -43,7 +43,7 @@ import java.util.logging.Level; | ||
|
Oops, something went wrong.