build: Kotlin DSL target matrix + Minecraft 26.2 support#31
Merged
Conversation
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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
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.
e9e08da to
2daad55
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate the whole build to Kotlin DSL with a target matrix and add the mc262 target (Minecraft 26.2, Java 25).
build.gradle/settings.gradleto Kotlin DSL.gradle/targets.properties, selected via-Ptarget=mcXXXX; addmc262(26.2 / Java 25).consumer-*plugins and a MagicUtils consumer registry/info/payloads API so downstream projects resolve the right per-target artifacts; wire platform providers through it.publish-javadoc.yml+ theme).DOCS_TODO.md(all items resolved).Verification
./gradlew assemble -Ptarget=mc262— BUILD SUCCESSFUL (fabric, neoforge, velocity, bukkit)../gradlew test -Ptarget=mc262— BUILD SUCCESSFUL (all module tests green).🤖 Generated with Claude Code