Skip to content

Commit f4b03c6

Browse files
committed
Shade and relocate cloud
1 parent 4b4fb79 commit f4b03c6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ plugins {
55
id("io.papermc.paperweight.userdev") version "1.7.2"
66
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
77
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"
811
}
912

1013
group = "io.papermc.paperweight"
@@ -33,6 +36,11 @@ dependencies {
3336
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
3437
// paperweight.foliaDevBundle("1.21-R0.1-SNAPSHOT")
3538
// 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")
3644
}
3745

3846
tasks {
@@ -53,6 +61,15 @@ tasks {
5361
outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
5462
}
5563
*/
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+
}
5673
}
5774

5875
// Configure plugin.yml generation

0 commit comments

Comments
 (0)