Skip to content

Commit d0b226d

Browse files
jpenillalynxplay
authored andcommitted
Shade and relocate cloud
1 parent 28044bf commit d0b226d

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 "2.0.0-beta.16"
66
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
77
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0" // 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("com.gradleup.shadow") version "8.3.5"
811
}
912

1013
group = "io.papermc.paperweight"
@@ -29,6 +32,11 @@ dependencies {
2932
paperweight.paperDevBundle("1.21.5-R0.1-SNAPSHOT")
3033
// paperweight.foliaDevBundle("1.21.5-R0.1-SNAPSHOT")
3134
// paperweight.devBundle("com.example.paperfork", "1.21.5-R0.1-SNAPSHOT")
35+
36+
// Shadow will include the runtimeClasspath by default, which implementation adds to.
37+
// Dependencies you don't want to include go in the compileOnly configuration.
38+
// Make sure to relocate shaded dependencies!
39+
implementation("org.incendo", "cloud-paper", "2.0.0-beta.10")
3240
}
3341

3442
tasks {
@@ -49,6 +57,15 @@ tasks {
4957
outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
5058
}
5159
*/
60+
61+
shadowJar {
62+
// helper function to relocate a package into our package
63+
fun reloc(pkg: String) = relocate(pkg, "io.papermc.paperweight.testplugin.dependency.$pkg")
64+
65+
// relocate cloud and it's transitive dependencies
66+
reloc("org.incendo.cloud")
67+
reloc("io.leangen.geantyref")
68+
}
5269
}
5370

5471
// Configure plugin.yml generation

0 commit comments

Comments
 (0)