Skip to content

Migrate Gradle build to Kotlin DSL and centralize dependency versions#129

Merged
darbyjack merged 16 commits into
masterfrom
feat/modernization
May 24, 2026
Merged

Migrate Gradle build to Kotlin DSL and centralize dependency versions#129
darbyjack merged 16 commits into
masterfrom
feat/modernization

Conversation

@darbyjack
Copy link
Copy Markdown
Owner

This pull request restructures the project to use a modular, multi-project Gradle setup, modernizes build tooling, and improves Minecraft version compatibility handling. The changes introduce new subprojects for particle compatibility, update Gradle and dependencies, and refactor how the correct version-specific implementation is selected at runtime.

Project structure and build system modernization:

  • Migrated from a single project with version, version_old, and version_new modules to a multi-project setup with particle-api, particle-legacy, and particle-modern modules, updating settings.gradle/settings.gradle.kts accordingly. [1] [2]
  • Updated Gradle wrapper from 8.6 to 9.5.1, enabled Gradle configuration cache, build caching, and parallel execution, and improved error messaging in gradlew/gradlew.bat. [1] [2] [3] [4] [5] [6] [7]

Dependency management:

  • Centralized library versions and plugin definitions using a gradle/libs.versions.toml file, and updated dependencies in new subproject build files. [1] [2] [3] [4]

Minecraft version compatibility improvements:

  • Added MinecraftVersion utility for robust parsing and comparison of server versions, including reflection-based detection for broader compatibility.
  • Introduced VersionHookFactory to dynamically select the correct particle compatibility implementation at runtime, replacing previous static selection logic. [1] [2] [3]

Code cleanup and refactoring:

  • Removed obsolete version, version_old, and version_new modules and their build scripts, consolidating logic into the new modular structure. [1] [2] [3]
  • Updated VersionHookNew implementation to use the modern modular structure and improved particle spawning logic. [1] [2] [3] [4]

These changes collectively improve maintainability, build performance, and compatibility across different Minecraft server versions.

darbyjack added 16 commits May 20, 2026 09:27
Convert the root and subproject Gradle scripts from Groovy DSL to Kotlin DSL while preserving the existing project structure and dependency versions.

Keep the existing version, version_old, and version_new modules unchanged so the current particle compatibility boundary stays intact.

Temporarily remove the Indra Java 8 toolchain requirement from the active build configuration to allow the project to compile with the locally installed JDK while still emitting Java 8 compatible bytecode.

Configure Java and Kotlin compilation consistently for Java 8 bytecode across all projects, fixing the Kotlin/Java target mismatch during the migration.

Preserve the existing Shadow jar configuration, dependency relocation rules, resource token replacement, and final VoteParty jar naming.
Add a Gradle version catalog for plugin, library, and Minecraft API dependencies while preserving the existing resolved versions and module structure.

Move dependency declarations out of shared allprojects configuration so each module explicitly declares the catalog-backed dependencies it uses.

Keep the existing version, version_old, and version_new particle compatibility modules unchanged for this behavior-preserving step.
Replace the dynamic ParticleAPI version selector with the currently resolved 2.2.0-SNAPSHOT version in the Gradle version catalog.

Keep the legacy particle implementation behavior unchanged while making dependency resolution deterministic for Minecraft 1.8.8 compatibility work.
Switch from the old io.github.goooler.shadow fork to the maintained com.gradleup.shadow plugin while staying on a Gradle 8-compatible Shadow 8.3.x release.

Preserve the existing shadowJar configuration, relocation rules, minimize behavior, and VoteParty jar naming.
Replace the deprecated kotlinOptions configuration with the modern compilerOptions DSL while preserving Java 8 bytecode output and Java parameter metadata.
Upgrade the Gradle wrapper to 9.x and move Shadow to the latest maintained com.gradleup.shadow release.

Keep the VoteParty shadowJar build producing the same named artifact with existing relocation rules, minimize behavior, and Java 8 bytecode output.

Preserve the current module layout and compatibility boundary so runtime compatibility work can continue separately.
Update the Kotlin Gradle plugin and Kotlin standard library through the Gradle version catalog.

Keep Java 8 bytecode output, existing module layout, Shadow packaging, and compatibility boundaries unchanged.
Update the Ben Manes Gradle Versions plugin for Gradle 9 compatibility.

Restore the dependencyUpdates task so dependency modernization can be audited after the Gradle wrapper upgrade.
Update XSeries through the Gradle version catalog and adapt the modern particle hook to the newer nullable Bukkit particle mapping.

Return early when a mapped XParticle does not resolve to a Bukkit Particle so unsupported particles do not break modern-version startup or particle display.
Update adventure-platform-bukkit through the Gradle version catalog while preserving the existing Adventure API and MiniMessage versions used by the plugin.
Update bStats Bukkit through the Gradle version catalog while preserving the existing shaded metrics relocation.
Rename the generic version modules to particle-api, particle-legacy, and particle-modern to reflect their actual responsibility.

Keep package names, behavior, and particle compatibility logic unchanged so the refactor remains module-structure only.
Switch the root plugin compileOnly Bukkit API to the legacy Spigot 1.8.8 API so common code is guarded against accidental modern-only Bukkit usage.

Keep the modern particle module compiling against the modern Spigot API while the shared plugin code remains legacy-safe.
Add a Minecraft version helper that handles both legacy 1.x versions and the newer year-based version schema used by current Paper releases.

Move particle hook construction behind a factory so only the selected legacy or modern implementation is loaded at runtime.

Exclude particle compatibility modules and reflection-heavy dependencies from Shadow minimization so reflectively loaded hook classes remain in the final jar.
Enable Gradle configuration cache, build cache, and parallel execution for faster repeated local builds after validating the main shadowJar and Paper runtime test tasks.
Replace the legacy Gradle workflow with focused CI and dependency review workflows using current major action versions.

Use Java 25 for Gradle 9 execution and Gradle setup with built-in wrapper validation while keeping runtime server tests local-only.
@darbyjack darbyjack merged commit bcf6d6b into master May 24, 2026
2 checks passed
@darbyjack darbyjack deleted the feat/modernization branch May 24, 2026 20:54
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