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 Apr 11, 2024
1 parent aded5c0 commit 89197ca
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.5.15"
id("xyz.jpenilla.run-paper") version "2.2.3" // 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("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "io.papermc.paperweight"
Expand All @@ -20,6 +23,11 @@ dependencies {
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
// paperweight.foliaDevBundle("1.20.4-R0.1-SNAPSHOT")
// paperweight.devBundle("com.example.paperfork", "1.20.4-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("cloud.commandframework", "cloud-paper", "1.8.4")
}

tasks {
Expand All @@ -46,6 +54,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("cloud.commandframework")
reloc("io.leangen.geantyref")
}
}

// Configure plugin.yml generation
Expand Down

0 comments on commit 89197ca

Please sign in to comment.