9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-19 14:59:19 +00:00

Fix shadow setup

This commit is contained in:
SamB440
2025-07-14 20:32:45 +01:00
parent 23b6382131
commit b7e09470e6
4 changed files with 40 additions and 27 deletions

View File

@@ -1,7 +1,6 @@
plugins {
// Apply the java Plugin to add support for Java.
java
id("com.gradleup.shadow")
id("com.diffplug.spotless")
// id("net.kyori.indra.licenser.spotless")
}
@@ -68,9 +67,9 @@ version = project.version
dependencies {
constraints {
// Define dependency versions as constraints
compileOnly("net.kyori:adventure-api:4.17.0")
implementation("net.kyori:adventure-api:4.17.0")
testImplementation("net.kyori:adventure-api:4.17.0")
compileOnly("net.kyori:adventure-api:4.23.0")
implementation("net.kyori:adventure-api:4.23.0")
testImplementation("net.kyori:adventure-api:4.23.0")
}
implementation("com.convallyria.languagy:api:3.0.3-SNAPSHOT")
@@ -109,25 +108,4 @@ tasks {
options.encoding = Charsets.UTF_8.name()
options.release.set(16)
}
build {
dependsOn(shadowJar)
}
shadowJar {
archiveBaseName.set("rpgregions-2-${project.name}")
archiveClassifier.set("")
// relocate("net.kyori", "rpgregions-libs.adventure")
relocate("com.google.gson", "rpgregions-libs.gson")
relocate("org.incendo.cloud", "rpgregions-libs.commandframework")
relocate("io.leangen.geantyref", "rpgregions-libs.typetoken")
relocate("com.convallyria.languagy", "rpgregions-libs.languagy")
relocate("io.papermc.lib", "rpgregions-libs.paperlib")
relocate("redempt.crunch", "rpgregions-libs.crunch")
relocate("co.aikar.idb", "rpgregions-libs.idb")
relocate("com.github.stefvanschie.inventoryframework", "rpgregions-libs.inventoryframework")
relocate("org.bstats", "rpgregions-libs.bstats")
relocate("me.lucko.helper", "rpgregions-libs.helper")
relocate("net.wesjd", "rpgregions-libs.anvilgui")
}
}

View File

@@ -24,8 +24,12 @@ publishing {
from(components["java"])
// skip shadow jar from publishing. Workaround for https://github.com/johnrengelman/shadow/issues/651
val javaComponent = components["java"] as AdhocComponentWithVariants
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() }
val shadowRuntimeElements = configurations.findByName("shadowRuntimeElements")
if (shadowRuntimeElements != null) {
println("Published project ${project.name} will ignore shadowRuntimeElements")
val javaComponent = components["java"] as AdhocComponentWithVariants
javaComponent.withVariantsFromConfiguration(shadowRuntimeElements) { skip() }
}
}
}

View File

@@ -0,0 +1,30 @@
plugins {
// Apply the java Plugin to add support for Java.
java
id("com.gradleup.shadow")
}
tasks {
build {
dependsOn(shadowJar)
}
shadowJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveBaseName.set("rpgregions-2-${project.name}")
archiveClassifier.set("")
// relocate("net.kyori", "rpgregions-libs.adventure")
relocate("com.google.gson", "rpgregions-libs.gson")
relocate("org.incendo.cloud", "rpgregions-libs.commandframework")
relocate("io.leangen.geantyref", "rpgregions-libs.typetoken")
relocate("com.convallyria.languagy", "rpgregions-libs.languagy")
relocate("io.papermc.lib", "rpgregions-libs.paperlib")
relocate("redempt.crunch", "rpgregions-libs.crunch")
relocate("co.aikar.idb", "rpgregions-libs.idb")
relocate("com.github.stefvanschie.inventoryframework", "rpgregions-libs.inventoryframework")
relocate("org.bstats", "rpgregions-libs.bstats")
relocate("me.lucko.helper", "rpgregions-libs.helper")
relocate("net.wesjd.anvilgui", "rpgregions-libs.anvilgui")
}
}