Skip to content

Refactor Gradle build logic and update dependencies#3309

Merged
MattBDev merged 18 commits intomainfrom
build-logic-improvements
Oct 8, 2025
Merged

Refactor Gradle build logic and update dependencies#3309
MattBDev merged 18 commits intomainfrom
build-logic-improvements

Conversation

@MattBDev
Copy link
Copy Markdown
Contributor

Enhance the Gradle build configuration by refining dependency management, updating the Gradle wrapper, and improving project structure. This includes adopting common practices, resolving issues, and adding new repositories for better dependency resolution.

Above description was written by Copilot. More thorough description will come later. Main purpose of publishing the draft PR is to get eyes on early issues I may have missed.

@github-actions
Copy link
Copy Markdown

Please take a moment and address the merge conflicts of your pull request. Thanks!

octylFractal and others added 11 commits September 23, 2025 14:50
(cherry picked from commit cd8bca9)
Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>
… common Gradle practices.

Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>
Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>
Gradle 9 changed the behavior of this code but didn't set off any deprecation warnings...🙄
@MattBDev MattBDev force-pushed the build-logic-improvements branch from d7f3d1f to 9e23c03 Compare September 23, 2025 19:44
@MattBDev MattBDev marked this pull request as ready for review September 23, 2025 20:08
@MattBDev MattBDev requested a review from a team as a code owner September 23, 2025 20:08
@MattBDev MattBDev requested a review from Copilot September 23, 2025 20:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the Gradle build configuration to use a centralized build-logic approach, updating dependencies and improving project structure. The changes modernize the build system by consolidating build logic into reusable plugins and updating the Gradle wrapper to version 9.0.0.

Key changes:

  • Migrated from inline buildSrc configuration to a structured build-logic module with reusable plugins
  • Updated Gradle wrapper from 8.14.3 to 9.0.0
  • Standardized dependency management using version catalogs and updated library references

Reviewed Changes

Copilot reviewed 49 out of 52 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
settings.gradle.kts Added build-logic inclusion and repository configuration
gradle/wrapper/gradle-wrapper.properties Updated Gradle version to 9.0.0
gradle/libs.versions.toml Restructured dependency versions and library definitions
build-logic/* New centralized build logic with reusable plugins
worldedit-*/build.gradle.kts Migrated to use new build-logic plugins
buildSrc/* Removed old build configuration files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread worldedit-sponge/build.gradle.kts
Comment thread worldedit-mod/build.gradle.kts
Comment thread build-logic/src/main/kotlin/buildlogic.libs.gradle.kts Outdated
Comment thread build-logic/src/main/kotlin/buildlogic.libs.gradle.kts Outdated
Comment thread build-logic/src/main/kotlin/repositoriesHelper.kt
Comment thread build-logic/src/main/kotlin/buildlogic.libs.gradle.kts Outdated
Comment thread settings.gradle.kts Outdated
Comment thread gradle/wrapper/gradle-wrapper.properties Outdated
@NotMyFault NotMyFault requested a review from Copilot October 3, 2025 17:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 48 out of 51 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@NotMyFault
Copy link
Copy Markdown
Collaborator

Building failes because of https://github.com/IntellectualSites/FastAsyncWorldEdit/actions/runs/18182916991/job/51908846246?pr=3309#step:6:58


* What went wrong:
Could not determine the dependencies of task ':worldedit-libs:bukkit:jar'.
> Could not resolve all files for configuration ':worldedit-libs:bukkit:shade'.
   > Could not find text-adapter-bukkit-3.0.6.jar (net.kyori:text-adapter-bukkit:3.0.6).
     Searched in the following locations:
         https://maven.enginehub.org/repo/net/kyori/text-adapter-bukkit/3.0.6/text-adapter-bukkit-3.0.6.jar

This should be retrieved from https://repo.maven.apache.org/maven2/net/kyori/text-adapter-bukkit/3.0.6/

@SirYwell
Copy link
Copy Markdown
Member

SirYwell commented Oct 4, 2025

Building failes because of IntellectualSites/FastAsyncWorldEdit/actions/runs/18182916991/job/51908846246?pr=3309#step:6:58


* What went wrong:
Could not determine the dependencies of task ':worldedit-libs:bukkit:jar'.
> Could not resolve all files for configuration ':worldedit-libs:bukkit:shade'.
   > Could not find text-adapter-bukkit-3.0.6.jar (net.kyori:text-adapter-bukkit:3.0.6).
     Searched in the following locations:
         https://maven.enginehub.org/repo/net/kyori/text-adapter-bukkit/3.0.6/text-adapter-bukkit-3.0.6.jar

This should be retrieved from repo.maven.apache.org/maven2/net/kyori/text-adapter-bukkit/3.0.6

EH should mirror that stuff, but they currently have problems fetching from other repositories somehow.

@SirYwell
Copy link
Copy Markdown
Member

SirYwell commented Oct 5, 2025

Looks like the Paper jar is bigger due to fastutil not being minimized. However, do we even need to include it? We don't expose the relocated variant as API and paper provides fastutil. Can we exclude it? (Not sure if we can exclude it on Spigot, but it's probably fine to keep it as-is there)

Other dependencies aren't minimized as well, but these contribute far less to the size.

@PierreSchwang
Copy link
Copy Markdown
Member

Looks like the Paper jar is bigger due to fastutil not being minimized. However, do we even need to include it? We don't expose the relocated variant as API and paper provides fastutil. Can we exclude it? (Not sure if we can exclude it on Spigot, but it's probably fine to keep it as-is there)

Other dependencies aren't minimized as well, but these contribute far less to the size.

That's an issue with the new shadow version I think. The same happened when I updated it, and had to rollback to the previous major version. Don't know why. I just know that the plugin did not run either back then.

@SirYwell
Copy link
Copy Markdown
Member

SirYwell commented Oct 5, 2025

Was it only for the paper module back then too?

Copy link
Copy Markdown
Collaborator

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

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

Preliminary approval to unblock builds on the default branch.

@PierreSchwang
Copy link
Copy Markdown
Member

Was it only for the paper module back then too?

I don't really know. For reference the reporting message in fawe-support: https://discord.com/channels/268444645527126017/344128526435221505/1411442944963248209
It affected fastutil as well (wasn't minimized for paper, but for spigot). And other classes were just not bundled.

@MattBDev MattBDev force-pushed the build-logic-improvements branch from 52b15d2 to 508613d Compare October 8, 2025 03:49
@MattBDev MattBDev merged commit 1dd3f5a into main Oct 8, 2025
12 checks passed
@MattBDev MattBDev deleted the build-logic-improvements branch October 8, 2025 04:10
MattBDev added a commit that referenced this pull request Oct 8, 2025
* Add foojay to download JVMs.

(cherry picked from commit cd8bca9)
Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>

* Renamed some dependencies to kebab-case for clarity and to align with common Gradle practices.

Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>

* Refine build logic and dependency management in Gradle configuration.

Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>

* Update Gradle wrapper to version 9.0.0

* Fix internalVersion expansion to use mapOf.
Gradle 9 changed the behavior of this code but didn't set off any deprecation warnings...🙄

* Refactor build logic to use plugins for dependency management and improve project structure.

* Update tasks in build.gradle.kt to use configureEach for improved performance with lazy configuration.

* Refactor dependencies in build.gradle.kts and libs.versions.toml for consistency

* Add build-logic-improvements branch to GitHub Actions workflow for CI

* Set maxParallelForks for tests based on available processors

* Fixed a rebase issue

* Update Target JVM version from 16 to 21 in library attributes

* Add intellectualsites repository to allowed prefixes for better up-time guarantees

* Updated gradle wrapper and foojay-resolver-convention plugin

* Add PaperMC repository to adapter build logic

* Refactor build logic to exclude net.kyori group from EngineHub repository and stop relocating and bundling fastutil

* Reformatted buildlogic.platform.gradle.kts

* Fixed artifact generation

---------

Signed-off-by: Matt Bonanno <4009945+MattBDev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants