@@ -5,6 +5,9 @@ plugins {
5
5
id(" io.papermc.paperweight.userdev" ) version " 1.7.2"
6
6
id(" xyz.jpenilla.run-paper" ) version " 2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
7
7
id(" xyz.jpenilla.resource-factory-bukkit-convention" ) version " 1.1.1" // Generates plugin.yml based on the Gradle config
8
+
9
+ // Shades and relocates dependencies into our plugin jar. See https://imperceptiblethoughts.com/shadow/introduction/
10
+ id(" io.github.goooler.shadow" ) version " 8.1.7"
8
11
}
9
12
10
13
group = " io.papermc.paperweight"
@@ -33,6 +36,11 @@ dependencies {
33
36
paperweight.paperDevBundle(" 1.21-R0.1-SNAPSHOT" )
34
37
// paperweight.foliaDevBundle("1.21-R0.1-SNAPSHOT")
35
38
// paperweight.devBundle("com.example.paperfork", "1.21-R0.1-SNAPSHOT")
39
+
40
+ // Shadow will include the runtimeClasspath by default, which implementation adds to.
41
+ // Dependencies you don't want to include go in the compileOnly configuration.
42
+ // Make sure to relocate shaded dependencies!
43
+ implementation(" org.incendo" , " cloud-paper" , " 2.0.0-beta.8" )
36
44
}
37
45
38
46
tasks {
@@ -53,6 +61,15 @@ tasks {
53
61
outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
54
62
}
55
63
*/
64
+
65
+ shadowJar {
66
+ // helper function to relocate a package into our package
67
+ fun reloc (pkg : String ) = relocate(pkg, " io.papermc.paperweight.testplugin.dependency.$pkg " )
68
+
69
+ // relocate cloud and it's transitive dependencies
70
+ reloc(" org.incendo.cloud" )
71
+ reloc(" io.leangen.geantyref" )
72
+ }
56
73
}
57
74
58
75
// Configure plugin.yml generation
0 commit comments