mirror of https://github.com/GeyserMC/Geyser.git
Shade and relocate dependencies that don't conform to SemVer on Fabric
This commit is contained in:
parent
e56b38ab90
commit
7aee0a72f5
|
@ -17,9 +17,19 @@ dependencies {
|
|||
shadow(project(path = ":mod", configuration = "transformProductionFabric")) {
|
||||
isTransitive = false
|
||||
}
|
||||
|
||||
shadow(projects.core) { isTransitive = false }
|
||||
includeTransitive(projects.core)
|
||||
shadow(project(path = ":core")) { isTransitive = false }
|
||||
|
||||
// These are NOT transitively included, and instead shadowed + relocated.
|
||||
// Avoids fabric complaining about non-SemVer versioning
|
||||
shadow(libs.protocol.connection) { isTransitive = false }
|
||||
shadow(libs.protocol.common) { isTransitive = false }
|
||||
shadow(libs.protocol.codec) { isTransitive = false }
|
||||
shadow(libs.mcauthlib) { isTransitive = false }
|
||||
shadow(libs.raknet) { isTransitive = false }
|
||||
shadow(libs.netty.codec.haproxy) { isTransitive = false }
|
||||
shadow("org.cloudburstmc:nbt:3.0.2.Final") { isTransitive = false }
|
||||
shadow("io.netty:netty-codec-dns:4.1.103.Final") { isTransitive = false }
|
||||
|
||||
modImplementation(libs.fabric.permissions)
|
||||
include(libs.fabric.permissions)
|
||||
|
@ -30,6 +40,10 @@ application {
|
|||
}
|
||||
|
||||
tasks {
|
||||
shadowJar {
|
||||
relocate("org.cloudburstmc", "org.geysermc.relocate.cloudburst")
|
||||
relocate("com.github.steveice10.mc.auth", "org.geysermc.relocate.mcauth")
|
||||
}
|
||||
remapJar {
|
||||
archiveBaseName.set("Geyser-Fabric")
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ dependencies {
|
|||
shadow(project(path = ":core")) { isTransitive = false }
|
||||
|
||||
includeTransitive(projects.core)
|
||||
|
||||
}
|
||||
|
||||
application {
|
||||
|
|
|
@ -81,22 +81,22 @@ tasks {
|
|||
}
|
||||
|
||||
afterEvaluate {
|
||||
val dependenciesSet = getProvidedDependenciesForProject(project.name)
|
||||
val providedDependencies = getProvidedDependenciesForProject(project.name)
|
||||
|
||||
// We shadow e.g. geyser-core in. The resolved configuration however would JiJ core once more, leading to duplicates
|
||||
// Hence: Remove the initially provided dependencies.
|
||||
configurations["includeTransitive"].dependencies.forEach{ initDependency ->
|
||||
dependenciesSet.add("${initDependency.group}:${initDependency.name}")
|
||||
// These are shaded, no need to JiJ them
|
||||
configurations["shadow"].dependencies.forEach {shadowed ->
|
||||
println("Not including shadowed dependency: ${shadowed.group}:${shadowed.name}")
|
||||
providedDependencies.add("${shadowed.group}:${shadowed.name}")
|
||||
}
|
||||
|
||||
// Now: Include all transitive dependencies that aren't excluded
|
||||
configurations["includeTransitive"].resolvedConfiguration.resolvedArtifacts.forEach { dep ->
|
||||
if (!dependenciesSet.contains("${dep.moduleVersion.id.group}:${dep.moduleVersion.id.name}")
|
||||
and !dependenciesSet.contains("${dep.moduleVersion.id.group}:*")) {
|
||||
if (!providedDependencies.contains("${dep.moduleVersion.id.group}:${dep.moduleVersion.id.name}")
|
||||
and !providedDependencies.contains("${dep.moduleVersion.id.group}:*")) {
|
||||
println("Including dependency via JiJ: ${dep.id}")
|
||||
dependencies.add("include", dep.moduleVersion.id.toString())
|
||||
} else {
|
||||
println("Not including ${dep.id}, already provided on ${project.name}!")
|
||||
println("Not including ${dep.id} for ${project.name}!")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue