fix shading config

This commit is contained in:
dfsek
2022-05-05 14:56:51 -07:00
parent 6e61154cc5
commit 98b332fe54
5 changed files with 25 additions and 8 deletions

View File

@@ -9,6 +9,23 @@ fun Project.configureDependencies() {
val testImplementation by configurations.getting
val compileOnly by configurations.getting
val api by configurations.getting
val implementation by configurations.getting
val shaded by configurations.creating
@Suppress("UNUSED_VARIABLE")
val shadedApi by configurations.creating {
shaded.extendsFrom(this)
api.extendsFrom(this)
}
@Suppress("UNUSED_VARIABLE")
val shadedImplementation by configurations.creating {
shaded.extendsFrom(this)
implementation.extendsFrom(this)
}
repositories {
mavenCentral()
gradlePluginPortal()

View File

@@ -121,7 +121,7 @@ fun Project.configureDistribution() {
tasks.named<ShadowJar>("shadowJar") {
// Tell shadow to download the packs
dependsOn(downloadDefaultPacks)
configurations = listOf(project.configurations["shaded"])
archiveClassifier.set("shaded")
setVersion(project.version)
relocate("org.apache.commons", "com.dfsek.terra.lib.commons")

View File

@@ -14,7 +14,7 @@ val paperURL = "https://papermc.io/api/v2/projects/paper/versions/%version%/buil
val purpurURL = "https://api.pl3x.net/v2/purpur/%version%/latest/download"
dependencies {
api(project(":common:implementation:base"))
shadedApi(project(":common:implementation:base"))
api("org.slf4j:slf4j-api:1.8.0-beta4") {
because("Minecraft 1.17+ includes slf4j 1.8.0-beta4, so we need to shade it for other versions.")

View File

@@ -3,13 +3,13 @@ repositories {
}
dependencies {
api("commons-io:commons-io:2.7")
api("com.github.Querz:NBT:6.1")
api(project(":common:implementation:base"))
shadedApi("commons-io:commons-io:2.7")
shadedApi("com.github.Querz:NBT:6.1")
shadedApi(project(":common:implementation:base"))
implementation("com.google.guava:guava:31.0.1-jre")
shadedImplementation("com.google.guava:guava:31.0.1-jre")
implementation("ch.qos.logback:logback-classic:1.2.9")
shadedImplementation("ch.qos.logback:logback-classic:1.2.9")
implementation("net.jafama", "jafama", Versions.Libraries.Internal.jafama)
}

View File

@@ -8,7 +8,7 @@ plugins {
}
dependencies {
api(project(":common:implementation:base"))
shadedApi(project(":common:implementation:base"))
minecraft("com.mojang:minecraft:${Versions.Fabric.minecraft}")
mappings("net.fabricmc:yarn:${Versions.Fabric.yarn}:v2")