This repository is the standalone project setup and build pipeline for a Fabric mod workspace.
Its job is to:
- load the host project's module graph from
../toolchain.toml - generate IntelliJ project metadata for the modules
- prepare the Fabric development runtime bundles and generated run configurations
toolchain.toml is the authoritative project configuration boundary for the host project. It
captures the project id/name, tracked Minecraft version, default development module, and the
per-module roots, dependencies, aggregate members, artifact ids, Fabric mod ids, mixins, and
datagen outputs that the reusable toolchain engine consumes.
For the full schema and worked examples, see toolchain/PROJECT_SPEC.md.
The preferred TOML shape is intentionally compact:
- use
kind = "fabric_split_sources"for normal Fabric modules with sharedsrc/mainandsrc/client - use
dependency = "..."andannotation_processor = "..."when only one entry is needed - use
main_mixins = ["..."]andclient_mixins = ["..."]with resource-relative file names - use
generated_sources = true,generated_client_sources = true, ordatagen = truewhen the default roots are correct - use external dependency shorthand like
"group:artifact:version @ maven_central"when table syntax is unnecessary
The supported day-to-day workflow is wrapper-first:
- the toolchain generates the root-project IntelliJ metadata and Fabric run configurations
- IntelliJ builds host-project module outputs into
out/production/... - the generated
Fabric Client (platform),Fabric Server (platform), orFabric Datagen <module> (platform)run configuration launchesnet.fabricmc.devlaunchinjector.Main toolchain.shortoolchain.ps1runs the packaged toolchain jar fromtoolchain/bin/
On Linux, the shell wrapper requires wget when it needs to download a missing jar.
The primary command is:
cd toolchain
./toolchain.sh dev setup-intellij --username Dev --uuid 00000000-0000-0000-0000-000000000000That command:
- synchronizes the host-project root IntelliJ metadata
- refreshes the generated Fabric client, server, and datagen development launch bundles
- resolves IntelliJ source attachments for Minecraft and published library jars when sources are available
- defaults the injected development module from the authoritative build graph
- accepts optional launch identity overrides through
--usernameand--uuid
The graph default is usually the host project's entrypoint or bundle module, which pulls the modeled bundle modules into the generated launch closure.
That aggregation is owned by the authoritative toolchain graph itself.
If you need a different injected module:
./toolchain.sh dev setup-intellij --module <id>From a fresh clone of a consuming project:
- place the built
toolchain-<version>.jarintoolchain/bin/ - run
./toolchain.sh dev setup-intellijfromtoolchain/ - open the tracked repository root in IntelliJ
- let IntelliJ reload the generated project metadata
- run the generated
Fabric Client (...),Fabric Server (...), or module-scopedFabric Datagen ...configuration
The first IDE launch will populate the IntelliJ-owned module outputs under out/production/....
Use the same setup command whenever one of these changes:
- pulled changes that touched the toolchain or the host
toolchain.toml - changed dependency or version configuration in
toolchain.toml - changed generated IntelliJ metadata or launch-shaping behavior
- need to switch the injected root module
Normal iteration after that is just IntelliJ:
- run or debug
Fabric Client (platform)orFabric Server (platform) - run the generated
Fabric Datagen <module> (platform)configuration for the module whose checked-insrc/main/generatedoutput you want to refresh - inspect Minecraft, Fabric, and other attached libraries directly from the IDE when their source jars are available
The toolchain can assemble local release-style jars from IntelliJ-owned outputs:
./toolchain.sh artifacts assemble --module pswg_entrypointFor CI or other environments without IntelliJ-managed compilation, use the toolchain-owned compile path first:
./toolchain.sh artifacts assemble --module pswg_entrypoint --ci-buildThat command:
- reads compiled classes and resources from
out/production/... - expands
${version}inside packagedfabric.mod.json - writes standalone module jars and aggregate bundle jars under
toolchain/work/artifacts/<version>/
With --ci-build, the toolchain first compiles the required module closure into
toolchain/work/ci-build/out/production/... using the JDK compiler and the same authoritative
module graph used by IntelliJ metadata generation.
The artifact workflow is local assembly only. It does not publish to Maven Central,
Modrinth, or CurseForge, and it expects the relevant modules to have already been compiled by
IntelliJ before packaging unless --ci-build is used.
Modules can also declare artifact_excludes in toolchain.toml to omit jar-entry glob patterns
such as **/assets/**/datagen/** from the final packaged artifact.
To build the standalone toolchain jar that the wrapper launches:
./gradlew toolchainJarThat writes toolchain/bin/toolchain-<git describe>.jar, which toolchain.sh and
toolchain.ps1 pick up automatically. The version string comes from the repository's git state
so release jars are traceable without a separate property file.
If you want the wrapper to download a missing jar automatically, add a small
toolchain.properties file next to the scripts:
repository=owner/toolchain
version=1.2.3When the configured version is not present in toolchain/bin/, the wrapper fetches
https://github.com/owner/toolchain/releases/download/1.2.3/toolchain-1.2.3.jar.
If the local jar exists, it always wins.
Datagen is always client-derived in the bespoke toolchain. Each generated datagen configuration is scoped to one module by:
fabric-api.datagen.modid=<that module's Fabric mod id>fabric-api.datagen.output-dir=<that module's checked-in src/main/generated>
That keeps the runtime classpath broad enough for downstream generators to build on upstream modules, while still preventing the common "ran the wrong datagen config and wrote into the wrong module" failure mode.
Most routine version bumps start in the host project's toolchain.toml.
- Minecraft:
update
minecraft_version, then rerundev setup-intellijso the toolchain regenerates the transformed compile jars, IntelliJ metadata, and Fabric launch bundle for the new version. - Fabric Loader or Fabric API:
update
loader_versionand/or the module dependencies intoolchain.toml, then rerundev setup-intellijand verify one real IntelliJ debug launch. - Other Maven dependencies:
update the owning module declaration in
toolchain.toml, then rerundev setup-intellijso IntelliJ project libraries and launch inputs stay aligned.
After any version change:
- run
./toolchain.sh dev setup-intellij - run
./toolchain.sh fabric inspect-dev --environment <client|server>if the launch contract might have changed - verify the generated
Fabric Client (platform)orFabric Server (platform)configuration still launches and debugs cleanly
If the update involves dev-launch-injector behavior, Fabric bootstrap changes, or launch-property
changes, see toolchain/DEVELOPMENT.md before changing the launch workflow code.