Stonecutter step 1: build 1.21.11 from a shared src/ #24

Merged
selimaj-dev merged 2 commits from stonecutter-scaffold into stonecutter 2026-09-27 02:56:42 +00:00
Owner

Step 1 of #8. This targets the stonecutter integration branch, not master: each migration step merges there, and stonecutter goes to master in one PR once every version is folded in and buildAll, CI and the in-game checks pass.

What changes

  • 1.21.11 moves to Stonecutter. Its version-specific code moves from versions/1.21.11/src to the top-level src/ (with git mv, so history follows), built by Stonecutter as :1.21.11. versions/1.21.11/ keeps its gradle.properties and run/.
  • Other versions unchanged. 1.21.4–1.21.10 still build from their own copies as :mc-<v>, with their Groovy scripts, until they're folded in.
  • Build scripts are Kotlin:
    • settings.gradle.kts applies Stonecutter (stonecutterVersions = listOf("1.21.11")) and skips those folders when including the mc-<v> projects.
    • stonecutter.gradle.kts configures the root project: the shared repositories, the common wiring and buildAll.
    • The root build.gradle.kts builds each Stonecutter version. It was 1.21.11's build.gradle.
    • Loom's version for Stonecutter versions is loom_version in the root gradle.properties, read in pluginManagement, because a Kotlin plugins {} block can't read properties.
  • At most two remapJar tasks run at once. buildAll used to run all eight together. Each loads a Minecraft classpath and remaps a ~50 MB jar, which doesn't fit in the 3 GB daemon heap: a cold build stalled in garbage collection for over 40 minutes, and an earlier run failed. A shared build service now limits it to two; a cold buildAll --no-build-cache takes about 2 minutes, twice in a row. This affected master too.
  • scripts/port.sh treats src/ as the active Stonecutter version (1.21.11), so changes port between it and the old copies in both directions.
  • README and VERSION_GUIDE.md describe the layout, version comments, switching the active version, and adding a version through Stonecutter.

Checks

  • Same jar as before: the 1.21.11 jar has the same 415 entries, fabric.mod.json and mixin configs as the previous layout. Two classes encode @ModifyVariable(at = …) slightly differently, but an untouched 1.21.10 rebuilt today shows the same thing, so it comes from dependency resolution, not Stonecutter. The Kotlin scripts build the same jar as the Groovy ones did.
  • Builds: ./gradlew compileJava (what the Check workflow runs) passes, and a cold buildAll builds all 8 jars.
  • In game: ./gradlew :1.21.11:runClient starts and reuses versions/1.21.11/run.
  • port.sh: tested porting from src/ into the old versions, and from 1.21.10 into src/ and 1.21.9.

Notes

  • The project is now :1.21.11, not :mc-1.21.11 (Stonecutter's default, as in emotes).
  • Moving the versions' gradle.properties into one stonecutter.properties.toml waits until every version is folded in.

🤖 Generated with Claude Code

Step 1 of #8. This targets the **`stonecutter` integration branch**, not `master`: each migration step merges there, and `stonecutter` goes to `master` in one PR once every version is folded in and `buildAll`, CI and the in-game checks pass. ## What changes - **1.21.11 moves to Stonecutter.** Its version-specific code moves from `versions/1.21.11/src` to the top-level `src/` (with `git mv`, so history follows), built by Stonecutter as `:1.21.11`. `versions/1.21.11/` keeps its `gradle.properties` and `run/`. - **Other versions unchanged.** 1.21.4–1.21.10 still build from their own copies as `:mc-<v>`, with their Groovy scripts, until they're folded in. - **Build scripts are Kotlin:** - `settings.gradle.kts` applies Stonecutter (`stonecutterVersions = listOf("1.21.11")`) and skips those folders when including the `mc-<v>` projects. - `stonecutter.gradle.kts` configures the root project: the shared repositories, the `common` wiring and `buildAll`. - The root `build.gradle.kts` builds each Stonecutter version. It was 1.21.11's `build.gradle`. - Loom's version for Stonecutter versions is `loom_version` in the root `gradle.properties`, read in `pluginManagement`, because a Kotlin `plugins {}` block can't read properties. - **At most two `remapJar` tasks run at once.** `buildAll` used to run all eight together. Each loads a Minecraft classpath and remaps a ~50 MB jar, which doesn't fit in the 3 GB daemon heap: a cold build stalled in garbage collection for over 40 minutes, and an earlier run failed. A shared build service now limits it to two; a cold `buildAll --no-build-cache` takes about 2 minutes, twice in a row. This affected `master` too. - **`scripts/port.sh`** treats `src/` as the active Stonecutter version (1.21.11), so changes port between it and the old copies in both directions. - **README and `VERSION_GUIDE.md`** describe the layout, version comments, switching the active version, and adding a version through Stonecutter. ## Checks - **Same jar as before:** the 1.21.11 jar has the same 415 entries, `fabric.mod.json` and mixin configs as the previous layout. Two classes encode `@ModifyVariable(at = …)` slightly differently, but an untouched 1.21.10 rebuilt today shows the same thing, so it comes from dependency resolution, not Stonecutter. The Kotlin scripts build the same jar as the Groovy ones did. - **Builds:** `./gradlew compileJava` (what the Check workflow runs) passes, and a cold `buildAll` builds all 8 jars. - **In game:** `./gradlew :1.21.11:runClient` starts and reuses `versions/1.21.11/run`. - **`port.sh`:** tested porting from `src/` into the old versions, and from 1.21.10 into `src/` and 1.21.9. ## Notes - The project is now `:1.21.11`, not `:mc-1.21.11` (Stonecutter's default, as in `emotes`). - Moving the versions' `gradle.properties` into one `stonecutter.properties.toml` waits until every version is folded in. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
selimaj-dev added 2 commits 2026-09-27 02:51:44 +00:00
Step 1 of #8. 1.21.11's version-specific code moves from versions/1.21.11/src
to the top-level src/, built by Stonecutter as the project :1.21.11. The other
versions still build from their own copies as :mc-<v> until they're folded in.

- settings.gradle: applies Stonecutter (Groovy controller) with
  stonecutterVersions = ["1.21.11"] and skips those folders when including
  the old mc-<v> projects.
- The old root build.gradle becomes stonecutter.gradle (the root project's
  script, with the shared repositories, common wiring and buildAll), and
  1.21.11's build.gradle becomes the root build.gradle that Stonecutter runs
  for each version. versions/1.21.11 keeps its gradle.properties and run/.
- The jar has the same 415 entries, fabric.mod.json and mixin configs as
  before; the only class differences also appear when rebuilding an
  untouched version today.
- scripts/port.sh treats src/ as the active Stonecutter version, so changes
  port between it and the old copies both ways.
- README and VERSION_GUIDE describe the layout, version comments and how to
  add a version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Switch the root build scripts to Kotlin and limit parallel remaps
Check / compile (pull_request) Successful in 7m47s
eebfe8fa4d
- settings.gradle, stonecutter.gradle and the root build.gradle become
  .kts. Loom's version for the Stonecutter versions moves to the root
  gradle.properties (loom_version), read by pluginManagement, since the
  Kotlin plugins block can't read properties. The old mc-<v> projects keep
  their Groovy scripts until they're folded in.
- buildAll ran all eight remapJar tasks at once. Each loads a Minecraft
  classpath and remaps a ~50 MB jar, which doesn't fit in the 3 GB daemon
  heap: a cold build stalled in garbage collection for 40+ minutes, and
  earlier runs failed. A shared build service now lets two remaps run
  together; a cold buildAll takes about 2 minutes.
- port.sh and VERSION_GUIDE follow the .kts file names.

The 1.21.11 jar is the same as with the Groovy scripts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
selimaj-dev added the area/buildarea/versions
type
refactor
labels 2026-09-27 02:52:00 +00:00
selimaj-dev merged commit a30cf4d3ab into stonecutter 2026-09-27 02:56:42 +00:00
selimaj-dev deleted branch stonecutter-scaffold 2026-09-27 02:56:46 +00:00
Sign in to join this conversation.