Migrate Gradle build to Kotlin DSL and centralize dependency versions#129
Merged
Conversation
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.
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.
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:
version,version_old, andversion_newmodules to a multi-project setup withparticle-api,particle-legacy, andparticle-modernmodules, updatingsettings.gradle/settings.gradle.ktsaccordingly. [1] [2]gradlew/gradlew.bat. [1] [2] [3] [4] [5] [6] [7]Dependency management:
gradle/libs.versions.tomlfile, and updated dependencies in new subproject build files. [1] [2] [3] [4]Minecraft version compatibility improvements:
MinecraftVersionutility for robust parsing and comparison of server versions, including reflection-based detection for broader compatibility.VersionHookFactoryto dynamically select the correct particle compatibility implementation at runtime, replacing previous static selection logic. [1] [2] [3]Code cleanup and refactoring:
version,version_old, andversion_newmodules and their build scripts, consolidating logic into the new modular structure. [1] [2] [3]VersionHookNewimplementation 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.