Skip to content

build: Kotlin DSL target matrix + Minecraft 26.2 support#31

Merged
THEROER merged 17 commits into
mainfrom
chore/mc262-build-migration
Jul 6, 2026
Merged

build: Kotlin DSL target matrix + Minecraft 26.2 support#31
THEROER merged 17 commits into
mainfrom
chore/mc262-build-migration

Conversation

@THEROER

@THEROER THEROER commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

Migrate the whole build to Kotlin DSL with a target matrix and add the mc262 target (Minecraft 26.2, Java 25).

  • Convert every build.gradle/settings.gradle to Kotlin DSL.
  • Introduce gradle/targets.properties, selected via -Ptarget=mcXXXX; add mc262 (26.2 / Java 25).
  • Add build-logic consumer-* plugins and a MagicUtils consumer registry/info/payloads API so downstream projects resolve the right per-target artifacts; wire platform providers through it.
  • CI: publish aggregated themed Javadoc on release (publish-javadoc.yml + theme).
  • Docs: DOCS_TODO.md (all items resolved).

Verification

  • ./gradlew assemble -Ptarget=mc262BUILD SUCCESSFUL (fabric, neoforge, velocity, bukkit).
  • ./gradlew test -Ptarget=mc262BUILD SUCCESSFUL (all module tests green).

🤖 Generated with Claude Code

THEROER added 3 commits July 4, 2026 14:00
release.yml dispatches publish-maven.yml with -f version=..., but the workflow
declared no inputs, so the dispatch failed with HTTP 422. Declare an optional
version input (informational; the published version is resolved from the
checked-out gradle.properties).
…ild packages

Reorganise the build-logic sources from the flat top-level Kotlin package into
namespaced packages (matrix, module, release, smoke, support, target, publish),
add the module-naming and publishing spec helpers, and update the build-logic
build script/properties accordingly. No behaviour change — the applied plugin
ids are unchanged.
Add publish-javadoc.yml and the shared Javadoc theme (theme.css, top.html);
the release workflow now dispatches the Javadoc publish alongside publish-maven.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @THEROER, your pull request is larger than the review limit of 150000 diff characters

Convert every build.gradle/settings.gradle to Kotlin DSL and introduce a
target matrix (gradle/targets.properties) selected via -Ptarget=mcXXXX,
adding the mc262 target (Minecraft 26.2, Java 25). Add build-logic
consumer-* plugins and a MagicUtils consumer registry/info/payloads API so
downstream projects resolve the right per-target artifacts, and wire the
platform providers through it. Refresh the reflection allowlist line numbers.
@THEROER THEROER force-pushed the chore/mc262-build-migration branch from e9e08da to 2daad55 Compare July 6, 2026 08:27
THEROER added 13 commits July 6, 2026 17:04
Replace the boolean embedMagicUtils flag with an EmbedMode enum
(AUTO, JAR_IN_JAR, SHADED, EXTERNAL) so the same vocabulary applies on
every loader. resolveEmbedMode() maps AUTO to the loader's native
technique (JAR_IN_JAR on Fabric/NeoForge, SHADED on Bukkit) and
fails fast with a helpful message when a mode is unsupported there
(e.g. JAR_IN_JAR on Bukkit, SHADED on Fabric/NeoForge).

Bukkit now honours the mode: SHADED (the default) keeps the modules on
api/implementation for the shadow jar, EXTERNAL moves them to
compileOnly and strips the MagicUtils and jackson packages (including
multi-release copies) from the shadow jar, yielding a thin plugin that
expects a standalone MagicUtils at runtime. Fabric/NeoForge keep JiJ on
JAR_IN_JAR and drop it on EXTERNAL.

The -Pmagicutils_embed property maps true to AUTO and false to EXTERNAL,
so existing consumers keep working.
On Paper each plugin has its own classloader, so a plugin that shades
MagicUtils carries a private copy: two shaded consumers run two isolated
runtimes (separate config, consumer registry and /mu commands) that the
server owner never sees. Since the copies share no static state, every
MagicUtils instance now records its host in System.getProperties() (one
table per process, visible to every classloader) at bootstrap. When more
than one distinct host is present, a single warning names the hosts
(bundled/standalone plus versions) and tells the owner to install one
standalone MagicUtils and rebuild the consumers with magicutils_embed=false.

The detector's core takes plain values so it is unit-tested without a
running server.
The consumer registry now keeps a live runtime view per consumer instead
of a frozen snapshot: command and component counts change after a consumer
registers (commands are wired on server start, components while the runtime
builds), so snapshot()/find() rebuild the info from the view at call time.
On Bukkit the reflective bridge hands the bundle plugin a Supplier that
rebuilds the payload on demand, crossing the separate-classloader boundary
with JDK types only. Keeps /magicutils mods honest rather than showing an
early snapshot.
… rows clickable

Hoist the MiniMessage attribute escaper into MessageParser.escapeAttribute
so HelpCommandSupport and the bundle command reuse one implementation
instead of each carrying a private copy. Use it to wrap every /magicutils
mods row in a click/hover so selecting a mod runs /magicutils mod <name>.
Introduce an allTargets DSL and model so buildAllTargets can be shaped
from settings: a targets subset, a platform scenario, and the task type
(build / check / publishToMavenLocal). The matrix root plugin reads the
resolved spec and registers the fan-out task accordingly.
…loads

Add a paper-plugin.yml (with folia-supported) so the bundle loads as the
standalone MagicUtils Paper plugin, and expand the bundle build to expand
both plugin.yml and paper-plugin.yml. The bundle stores each shared-runtime
consumer as a Supplier of its payload rather than a frozen map, so
/magicutils mods reflects the consumer's current state at query time.
…registry

Replace the hand-built consumer payload in the Fabric and NeoForge
bootstraps with a registration on MagicUtilsConsumerRegistry, so the
shared-classloader loaders feed the same live view that /magicutils mods
reads instead of a frozen snapshot captured at startup.
Add :http-client to the fabric bundle's library projects; its only
external dependency (jackson) is already bundled via config-yaml/toml.
The Bukkit bootstrap re-pushed the consumer registration on every runtime
state and command change to keep the frozen payload fresh. With the live
payload supplier a single registration suffices — the bundle re-reads the
runtime when /magicutils mods runs — so drop the refresh wiring. Update the
reflection allowlist line number for the bridge getMethod call.
…models

Adjust imports and call the smoke model's toSmokeCases with the
defaultTarget parameter it now takes.
The consumer plugins gained the EmbedMode enum (replacing the boolean
embed flag), so publish the build-logic tool under a new version that
downstream consumers can pin to.
Both actions/setup-java (cache: gradle) and gradle/actions/setup-gradle
restored ~/.gradle, layering stale cross-branch Kotlin incremental state
over the checkout and producing bogus unresolved-reference/type-mismatch
errors in build-logic that never reproduce on a clean build. Let
setup-gradle own the cache, and clean build-logic before its test.
The Maven `target/` ignore rule also matched the build-logic source
package build/target/, so MagicUtilsTargetExtension/Conventions/Model were
never committed. CI (a clean checkout) had no target types, failing every
consumer/module plugin with unresolved references to MagicUtilsTargetExtension.
Anchor an exception for that package and add the missing sources.
@THEROER THEROER merged commit 0a446ce into main Jul 6, 2026
8 checks passed
@THEROER THEROER deleted the chore/mc262-build-migration branch July 10, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant