This commit is contained in:
Brian Neumann-Fopiano
2026-08-01 22:39:09 -04:00
parent 324cf9e095
commit a8217b42e9
220 changed files with 10626 additions and 1661 deletions
+34 -3
View File
@@ -225,10 +225,14 @@ tasks.named('shadowJar', ShadowJar).configure {
doFirst {
delete(fileTree(layout.buildDirectory.dir('libs')) {
include('Iris v* [Forge] *.jar')
include('iris-forge-*.jar')
})
delete(layout.buildDirectory.file("libs/Iris-${project.version}+mc${minecraftVersion}-forge.jar"))
}
manifest {
// FML 26.2 has no TOML mixin handling at all (ModFileParser reads neither [[mixins]] nor
// accessTransformers on Forge). This manifest attribute is the only registration mechanism;
// do not move it into mods.toml.
attributes('MixinConfigs': 'irisworldgen.entity.mixins.json,irisworldgen.client.mixins.json')
}
archiveFileName.set(irisArtifactName('Forge', "${minecraftVersion}+${loaderDisplayVersion(forgeVersion)}"))
@@ -240,16 +244,43 @@ tasks.named('shadowJar', ShadowJar).configure {
exclude('META-INF/*.SF')
exclude('META-INF/*.DSA')
exclude('META-INF/*.RSA')
// The only multi-release entry any bundled dependency contributes is an OSGi manifest. Keeping
// it forces `Multi-Release: true` onto the mod jar, which makes the loaders treat the whole
// archive as versioned and re-scan it per release directory for nothing.
exclude('META-INF/versions/**')
addMultiReleaseAttribute.set(false)
// Invalid package name on Java 9+ ('enum' is a keyword); a module-path scan chokes on it.
exclude('org/apache/commons/lang/enum/**')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
relocate('org.objectweb.asm', 'art.arcane.iris.shadow.asm')
relocate('io.sentry', 'art.arcane.iris.shadow.sentry')
// Compile-only annotation carriers. Shipping them duplicates packages other mods also ship.
exclude('org/jspecify/**')
exclude('com/google/errorprone/**')
exclude('com/google/j2objc/**')
exclude('org/checkerframework/**')
exclude('org/jetbrains/annotations/**')
exclude('org/intellij/lang/**')
// The Bukkit platform binding cannot load without org.bukkit on the classpath, which no mod
// loader has. Shipping it only adds dead classes that reference a missing package.
exclude('art/arcane/iris/platform/bukkit/**')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
relocate('org.objectweb.asm', 'art.arcane.iris.shadow.asm')
relocate('io.sentry', 'art.arcane.iris.shadow.sentry')
// Split-package guard. A co-installed mod that ships any of these at their original coordinates
// puts two copies of the same package on one module layer, which the loaders reject at boot
// (Terra ships paralithic; caffeine and dom4j are common in mod dependency trees). First-party
// art.arcane.volmlib is deliberately NOT relocated.
relocate('com.github.benmanes.caffeine', 'art.arcane.iris.shadow.caffeine')
relocate('com.googlecode.concurrentlinkedhashmap', 'art.arcane.iris.shadow.clhm')
relocate('com.dfsek.paralithic', 'art.arcane.iris.shadow.paralithic')
relocate('org.dom4j', 'art.arcane.iris.shadow.dom4j')
relocate('org.jaxen', 'art.arcane.iris.shadow.jaxen')
relocate('org.zeroturnaround.zip', 'art.arcane.iris.shadow.ztzip')
}
// The thin `jar` output carries valid mods.toml metadata plus the MixinConfigs manifest attribute
// but bundles zero dependencies. Installing it is an instant NoClassDefFoundError, and it sits in
// build/libs right next to the real artifact. shadowJar is the only shippable Forge jar.
tasks.named('jar').configure {
enabled = false
}
tasks.named('assemble').configure {