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:
@@ -1,7 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
// Apply the java Plugin to add support for Java.
|
// Apply the java Plugin to add support for Java.
|
||||||
java
|
java
|
||||||
id("com.gradleup.shadow")
|
|
||||||
id("com.diffplug.spotless")
|
id("com.diffplug.spotless")
|
||||||
// id("net.kyori.indra.licenser.spotless")
|
// id("net.kyori.indra.licenser.spotless")
|
||||||
}
|
}
|
||||||
@@ -68,9 +67,9 @@ version = project.version
|
|||||||
dependencies {
|
dependencies {
|
||||||
constraints {
|
constraints {
|
||||||
// Define dependency versions as constraints
|
// Define dependency versions as constraints
|
||||||
compileOnly("net.kyori:adventure-api:4.17.0")
|
compileOnly("net.kyori:adventure-api:4.23.0")
|
||||||
implementation("net.kyori:adventure-api:4.17.0")
|
implementation("net.kyori:adventure-api:4.23.0")
|
||||||
testImplementation("net.kyori:adventure-api:4.17.0")
|
testImplementation("net.kyori:adventure-api:4.23.0")
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation("com.convallyria.languagy:api:3.0.3-SNAPSHOT")
|
implementation("com.convallyria.languagy:api:3.0.3-SNAPSHOT")
|
||||||
@@ -109,25 +108,4 @@ tasks {
|
|||||||
options.encoding = Charsets.UTF_8.name()
|
options.encoding = Charsets.UTF_8.name()
|
||||||
options.release.set(16)
|
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")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -24,8 +24,12 @@ publishing {
|
|||||||
from(components["java"])
|
from(components["java"])
|
||||||
|
|
||||||
// skip shadow jar from publishing. Workaround for https://github.com/johnrengelman/shadow/issues/651
|
// skip shadow jar from publishing. Workaround for https://github.com/johnrengelman/shadow/issues/651
|
||||||
val javaComponent = components["java"] as AdhocComponentWithVariants
|
val shadowRuntimeElements = configurations.findByName("shadowRuntimeElements")
|
||||||
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() }
|
if (shadowRuntimeElements != null) {
|
||||||
|
println("Published project ${project.name} will ignore shadowRuntimeElements")
|
||||||
|
val javaComponent = components["java"] as AdhocComponentWithVariants
|
||||||
|
javaComponent.withVariantsFromConfiguration(shadowRuntimeElements) { skip() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("buildlogic.java-common-conventions")
|
id("buildlogic.java-common-conventions")
|
||||||
|
id("buildlogic.java-shadow-conventions")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Reference in New Issue
Block a user