Fix Gradle build performance issues and enable configuration cache support - #3616
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Gradle build logic to improve configuration-time performance and make the build compatible with Gradle’s configuration cache by removing legacy/eager configuration patterns and replacing Grgit-based Git metadata reads.
Changes:
- Replaced Grgit usage with
providers.execGit CLI calls for revision/date metadata to support configuration cache. - Removed an overly broad
compileJavadependency on:worldedit-libs:buildand adjusted resource expansion inputs to be configuration-cache safe. - Switched eager configuration hooks (
projectsEvaluated,configurations.all) to lazy equivalents (configureEach) to reduce configuration overhead.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
worldedit-core/build.gradle.kts |
Removes redundant task dependency and adjusts processResources expansion to avoid configuration-cache serialization issues. |
gradle/libs.versions.toml |
Removes the Grgit version-catalog entry to drop the legacy dependency. |
build.gradle.kts |
Replaces Grgit-based Git metadata with providers.exec to support configuration cache and reduce configuration-time work. |
build-logic/src/main/kotlin/buildlogic.common.gradle.kts |
Makes resolution strategy configuration lazy by using configurations.configureEach. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
53
to
58
| # Gradle plugins | ||
| pluginyml = "0.6.0" | ||
| mod-publish-plugin = "2.1.1" | ||
| grgit = "5.3.3" | ||
| shadow = "9.5.1" | ||
| paperweight = "2.0.0-SNAPSHOT" | ||
| codecov = "0.3.0" |
…pport
Replace Grgit/JGit with providers.exec for git metadata so the build no longer forks external processes at configuration time. Fix a Project-capturing closure in worldedit-core's fawe.properties expansion. Together these bring the configuration cache from 3 problems to 0.
Also remove a dependsOn(":worldedit-libs:build") in worldedit-core that pulled in the full build/check/sourcesJar/javadocJar lifecycle of two lib projects (bukkit, cli) it doesn't use -- 27 tasks reduced to 4 for :worldedit-core:compileJava -- and drop a redundant projectsEvaluated wrapper around an already-lazy configureEach block.
Verified: 0 configuration-cache problems (was 3); jar artifacts byte-for-byte identical (7560 entries compared) before/after and with the cache on/off; 197 tests passing; version stamp format unchanged.
MattBDev
force-pushed
the
gradle-optimizations
branch
from
August 10, 2026 02:16
44cd581 to
b34a18f
Compare
|
Please take a moment and address the merge conflicts of your pull request. Thanks! |
Comment on lines
64
to
68
|
|
||
| [libraries] | ||
| # Gradle plugins | ||
| grgit = { group = "org.ajoberstar.grgit", name = "grgit-gradle", version.ref = "grgit" } | ||
| shadow = { group = "com.gradleup.shadow", name = "shadow-gradle-plugin", version.ref = "shadow" } | ||
| paperweight = { group = "io.papermc.paperweight.userdev", name = "io.papermc.paperweight.userdev.gradle.plugin", version.ref = "paperweight" } |
R00tB33rMan
added a commit
to GemstoneGG/FastAsyncWorldEdit-Folia
that referenced
this pull request
Aug 25, 2026
Picks up the four commits IntellectualSites/main has since the last sync: f3a7f61 Remove PaperLib (IntellectualSites#3630) e2eddc5 Update dependency me.modmuss50.mod-publish-plugin to v2.2.0 (IntellectualSites#3631) a06d08e Update Gradle to v9.7.1 (IntellectualSites#3632) c5af107 Fix Gradle build performance issues and enable configuration cache support (IntellectualSites#3616) The PaperLib removal was already cherry-picked here from the PR branch (9661c92). Upstream squash-merged it as f3a7f61 and deleted the branch, and the merged form carries one file the branch tip did not: the adapter build logic's repository block, cleaned up during review. That is the only part of it missing, and it is what lands here; the rest of the fork is already free of PaperLib. c5af107 drops worldedit-core's dependsOn(":worldedit-libs:build"), which was the reason a single-module build needed --no-configure-on-demand. It no longer does, and --configuration-cache now stores and reuses an entry cleanly. The fork keeps its own build differences: the JDK 21 toolchain for the older adapters, the Adoptium vendor pin, and the Paper-only jar. Everything else in build.gradle.kts, libs.versions.toml, the wrapper and worldedit-core's build script now matches upstream exactly.
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.
Overview
Three small changes were made to the build scripts that remove redundant or legacy Gradle tasks/behavior. One of which unblocks Gradle's configuration cache and removes a dependency on a legacy Gradle plugin.
Description
providers.exec-based helper for reading the commit hash and date. Previously, Grgit forkedgittwice at configuration time, which the configuration cache does not support. Grgit will never add support for the configuration cache and is in fact considered to be in "maintenance mode".providers.execresults are recorded as declared build inputs instead, so they can be cached and replayed.allprojects { gradle.projectsEvaluated { ... } }wrapper around theconfigurateEachblocks.configureEachis already lazy and doesn't need an outer lifecycle hook. The wrapper was registering 18 identical callbacks (one per subproject) for no effect.worldedit-core:test.maxHeapSize, untouched by this block).tasks.compileJava { dependsOn(":worldedit-libs:build") }.:worldedit-libs:buildis a lifecycle task, not a jar — depending on it pulled in the full build/check/sourcesJar/javadocJar of all fourworldedit-libs:*projects, includingbukkitandcli, whichworldedit-coredoes not use. The existingapi(project(":worldedit-libs:core"))/annotationProcessor(project(":worldedit-libs:core:ap"))dependencies already carry correct task ordering via Gradle's variant-aware resolution (outgoing.artifact(tasks.named("jar"))inbuildlogic.libs.gradle.kts), so the explicitdependsOnwas redundant as well as too broad. It also brokeconfigureondemandfor any single-project build:configurations.all { }->configurations.configureEach { }. SameresolutionStrategy, applied lazily instead of eagerly realizing every configuration in all 18 projects at configuration time.Submitter Checklist
@since TODO.