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 Jun 15, 2024
1 parent 3f2a19d commit 191ee20
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.1"
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
id("xyz.jpenilla.resource-factory-bukkit-convention") version "1.1.1" // Generates plugin.yml based on the Gradle config

// Shades and relocates dependencies into our plugin jar. See https://imperceptiblethoughts.com/shadow/introduction/
id("io.github.goooler.shadow") version "8.1.7"
}

group = "io.papermc.paperweight"
Expand Down Expand Up @@ -33,6 +36,11 @@ dependencies {
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.21-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.21-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.8")
}

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 191ee20

Please sign in to comment.