Skip to content

Commit

Permalink
Shade and relocate cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Sep 25, 2024
1 parent 08c4e64 commit e0f0d31
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ plugins {
id("io.papermc.paperweight.userdev") version "1.7.2"
id("xyz.jpenilla.run-paper") version "2.3.1" // Adds runServer and runMojangMappedServer tasks for testing
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.2.0" // Generates plugin.yml based on the Gradle config

// Shades and relocates dependencies into our plugin jar. See https://imperceptiblethoughts.com/shadow/introduction/
id("com.gradleup.shadow") version "8.3.2"
}

group = "io.papermc.paperweight"
Expand Down Expand Up @@ -33,6 +36,11 @@ dependencies {
paperweight.paperDevBundle("1.21.1-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.21.1-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.21.1-R0.1-SNAPSHOT")

// Shadow will include the runtimeClasspath by default, which implementation adds to.
// Dependencies you don't want to include go in the compileOnly configuration.
// Make sure to relocate shaded dependencies!
implementation("org.incendo", "cloud-paper", "2.0.0-beta.10")
}

tasks {
Expand All @@ -53,6 +61,15 @@ tasks {
outputJar = layout.buildDirectory.file("libs/PaperweightTestPlugin-${project.version}.jar")
}
*/

shadowJar {
// helper function to relocate a package into our package
fun reloc(pkg: String) = relocate(pkg, "io.papermc.paperweight.testplugin.dependency.$pkg")

// relocate cloud and it's transitive dependencies
reloc("org.incendo.cloud")
reloc("io.leangen.geantyref")
}
}

// Configure plugin.yml generation
Expand Down

0 comments on commit e0f0d31

Please sign in to comment.