Skip to content

Commit

Permalink
Merge pull request #72 from GeorgeV220/master
Browse files Browse the repository at this point in the history
Fix shadowJar (#71) and workflow version retrieval
  • Loading branch information
unldenis authored Nov 3, 2024
2 parents 31a3ad9 + ca5fbca commit 64c37b4
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,4 @@ publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
}
}

tasks.register("printVersion") {
doLast {
println(project.version)
}
}
}
8 changes: 8 additions & 0 deletions holoeasy-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
}
}


tasks.register("printVersion") {
doLast {
println(project.version)
}
}


description = "holoeasy-core"
15 changes: 13 additions & 2 deletions holoeasy-example-packetevents/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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", "<your package name>.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")
}
}

24 changes: 23 additions & 1 deletion holoeasy-example-protocollib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
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", "<your package name>.holoeasy")
relocate("net.kyori", "org.holoeasy.plugin.kyori")
}
}

0 comments on commit 64c37b4

Please sign in to comment.