diff --git a/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts index 7f48271..6523152 100644 --- a/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/buildlogic.java-conventions.gradle.kts @@ -62,10 +62,4 @@ publishing { publications.create("maven") { from(components["java"]) } -} - -tasks.register("printVersion") { - doLast { - println(project.version) - } -} +} \ No newline at end of file diff --git a/holoeasy-core/build.gradle.kts b/holoeasy-core/build.gradle.kts index ed785ef..535239d 100644 --- a/holoeasy-core/build.gradle.kts +++ b/holoeasy-core/build.gradle.kts @@ -36,4 +36,12 @@ tasks.withType { } } + +tasks.register("printVersion") { + doLast { + println(project.version) + } +} + + description = "holoeasy-core" diff --git a/holoeasy-example-packetevents/build.gradle.kts b/holoeasy-example-packetevents/build.gradle.kts index 01a61c0..38a13f0 100644 --- a/holoeasy-example-packetevents/build.gradle.kts +++ b/holoeasy-example-packetevents/build.gradle.kts @@ -20,12 +20,15 @@ plugins { id("buildlogic.java-conventions") - id("com.github.johnrengelman.shadow") version "8.1.1" + id("com.gradleup.shadow") version "8.3.5" } dependencies { implementation(libs.org.jetbrains.kotlin.kotlin.stdlib) - implementation(project(":holoeasy-core")) + implementation(project(":holoeasy-core")) { + // Set the transitive dependency to false to avoid shading HoloEasy dependencies + isTransitive = false + } implementation(libs.com.github.retrooper.packetevents.spigot) compileOnly(libs.org.spigotmc.spigot.api) } @@ -34,7 +37,15 @@ description = "holoeasy-example-packetevents" tasks { shadowJar { + archiveClassifier.set("shadow") + archiveVersion.set("${project.version}") + // It is important to relocate org.holoeasy and io.github.retrooper.packetevents + // to avoid conflicts with other plugins + //relocate("org.holoeasy", ".holoeasy") + relocate("io.github.retrooper.packetevents", "org.holoeasy.plugin.packetevents") + relocate("com.github.retrooper.packetevents", "org.holoeasy.plugin.packetevents") + relocate("net.kyori", "org.holoeasy.plugin.kyori") } } diff --git a/holoeasy-example-protocollib/build.gradle.kts b/holoeasy-example-protocollib/build.gradle.kts index c19ef78..27f8f10 100644 --- a/holoeasy-example-protocollib/build.gradle.kts +++ b/holoeasy-example-protocollib/build.gradle.kts @@ -20,12 +20,34 @@ plugins { id("buildlogic.java-conventions") + `kotlin-dsl` + id("com.gradleup.shadow") version "8.3.5" } dependencies { implementation(libs.org.jetbrains.kotlin.kotlin.stdlib) - implementation(project(":holoeasy-core")) + implementation(project(":holoeasy-core")) { + // Set the transitive dependency to false to avoid shading HoloEasy dependencies + isTransitive = false + } compileOnly(libs.org.spigotmc.spigot.api) } description = "holoeasy-example-protocollib" + +tasks.withType { + kotlinOptions { + jvmTarget = "1.8" + } +} + +tasks { + shadowJar { + archiveClassifier.set("shadow") + archiveVersion.set("${project.version}") + + // It is important to relocate org.holoeasy to avoid conflicts with other plugins + //relocate("org.holoeasy", ".holoeasy") + relocate("net.kyori", "org.holoeasy.plugin.kyori") + } +} \ No newline at end of file diff --git a/holoeasy-example-protocollib/src/main/kotlin/ExamplePlugin.kt b/holoeasy-example-protocollib/src/main/kotlin/org/holoeasy/plugin/ExamplePlugin.kt similarity index 100% rename from holoeasy-example-protocollib/src/main/kotlin/ExamplePlugin.kt rename to holoeasy-example-protocollib/src/main/kotlin/org/holoeasy/plugin/ExamplePlugin.kt diff --git a/holoeasy-example-protocollib/src/main/kotlin/HelloWorldHologram.kt b/holoeasy-example-protocollib/src/main/kotlin/org/holoeasy/plugin/HelloWorldHologram.kt similarity index 100% rename from holoeasy-example-protocollib/src/main/kotlin/HelloWorldHologram.kt rename to holoeasy-example-protocollib/src/main/kotlin/org/holoeasy/plugin/HelloWorldHologram.kt