mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 14:59:27 +00:00
Fix: Build issues for Geyser-Fabric and Geyser-NeoForge
resolves: https://github.com/GeyserMC/Geyser/issues/5718 how did this work until now? we'll never know
This commit is contained in:
@@ -55,6 +55,11 @@ indra {
|
||||
|
||||
configurations {
|
||||
create("includeTransitive").isTransitive = true
|
||||
create("shadowBundle") {
|
||||
isCanBeResolved = true
|
||||
isCanBeConsumed = false
|
||||
isTransitive = false
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -68,7 +73,7 @@ tasks {
|
||||
|
||||
shadowJar {
|
||||
// Mirrors the example fabric project, otherwise tons of dependencies are shaded that shouldn't be
|
||||
configurations = listOf(project.configurations.shadow.get())
|
||||
configurations = listOf(project.configurations.getByName("shadowBundle"))
|
||||
// The remapped shadowJar is the final desired mod jar
|
||||
archiveVersion.set(project.version.toString())
|
||||
archiveClassifier.set("shaded")
|
||||
@@ -91,17 +96,15 @@ tasks {
|
||||
|
||||
afterEvaluate {
|
||||
val providedDependencies = providedDependencies[project.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}")
|
||||
}
|
||||
val shadedDependencies = configurations.getByName("shadowBundle")
|
||||
.dependencies.stream().map { dependency -> "${dependency.group}:${dependency.name}" }.toList()
|
||||
|
||||
// Now: Include all transitive dependencies that aren't excluded
|
||||
configurations["includeTransitive"].resolvedConfiguration.resolvedArtifacts.forEach { dep ->
|
||||
if (!providedDependencies.contains("${dep.moduleVersion.id.group}:${dep.moduleVersion.id.name}")
|
||||
and !providedDependencies.contains("${dep.moduleVersion.id.group}:.*")) {
|
||||
val name = "${dep.moduleVersion.id.group}:${dep.moduleVersion.id.name}"
|
||||
if (!shadedDependencies.contains(name) and !providedDependencies.contains(name)
|
||||
and !providedDependencies.contains("${dep.moduleVersion.id.group}:.*")
|
||||
) {
|
||||
println("Including dependency via JiJ: ${dep.id}")
|
||||
dependencies.add("include", dep.moduleVersion.id.toString())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user