Skip to content

build(fabric): every Xena mod relocates its core, then R8, then Loom - #165

Merged
zacharyk812 merged 2 commits into
mainfrom
feat/fabric-relocation
Nov 24, 2026
Merged

zacharyk812 merged 2 commits into
mainfrom
feat/fabric-relocation

Conversation

@zacharyk812

Copy link
Copy Markdown
Contributor

Every Xena Fabric mod now relocates its core, so two Xena mods never share core classes (#162).

Before this, xSample's Fabric jar carried the core under its original names. R8 renamed most classes, but it keeps the names its rules keep: the core API (co.xenastudios.**.api.**) and the entry points. Those stayed shared between mods, because Fabric loads every mod in one class loader.

  • xena.fabric-mod in build-logic packages a plugin's Fabric jar in two lines: id("xena.fabric-mod") after Loom, then xenaFabricMod { id = "xutilities" }. It applies xena.r8 and xena.fetched-libraries, and owns:
    • the bundle configuration and the jar contents
    • relocateJar (Shadow's task type): co.xenastudios.core → co.xenastudios.<id>.core
    • R8's input, libraries and package
    • Loom's remapJar input below 26.1
    • collect
  • Order: relocate → R8 → Loom remap (below 26.1; from 26.1 the shrunk jar ships). R8's keep rules and Loom both see the final names, and nothing rewrites R8's output afterwards.
  • xSample's and xTwin's Fabric builds use it. xSample's entry point moves from co.xenastudios.core.fabric.sandbox to co.xenastudios.xsample.fabric, so relocation never moves what fabric.mod.json names.
  • xTwin's Fabric jars are now shrunk and have budget lines: 322 / 324 / 366 KiB for 1.20.1 / 1.21.11 / 26.3 (before: unshrunk, no budget). xSample's sizes are unchanged (363 / 366 / 413 KiB). Neither jar has a class under co.xenastudios.core any more.

Verified

  • ./gradlew build and ./gradlew -p core/platform-fabric build collect pass.
  • The family test passes on Fabric 1.20.1 (Java 17) and 26.3 (Java 25), with both mods relocated and shrunk.

DECISIONS.md: "Fabric jars relocate their core".

Part of #123. Part of #162.

@github-actions github-actions Bot added documentation Improvements or additions to documentation core The shared core and build labels Nov 24, 2026
@zacharyk812
zacharyk812 force-pushed the feat/fabric-relocation branch from 4616377 to f0f5368 Compare November 24, 2026 22:14
xena.fabric-mod in build-logic packages a plugin's Fabric jar: the bundle,
the core relocated to co.xenastudios.<id>.core with Shadow, R8 on the
relocated jar, Loom's remap below 26.1, and collect. xSample's and xTwin's
Fabric jars use it, so the family test boots two relocated, shrunk mods;
xTwin's jars get budget lines, and xSample's entry point moves to its own
package.
@zacharyk812
zacharyk812 force-pushed the feat/fabric-relocation branch from f0f5368 to 2f342ac Compare November 24, 2026 22:29
@zacharyk812
zacharyk812 merged commit 6ceb4a3 into main Nov 24, 2026
30 checks passed
@zacharyk812
zacharyk812 deleted the feat/fabric-relocation branch November 24, 2026 22:38
@zacharyk812 zacharyk812 mentioned this pull request Nov 25, 2026
9 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core The shared core and build documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant