Fix Gradle build performance issues and enable configuration cache support - #3616
Open
MattBDev wants to merge 1 commit into
Open
Fix Gradle build performance issues and enable configuration cache support#3616MattBDev wants to merge 1 commit into
MattBDev wants to merge 1 commit into
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
MattBDev
enabled auto-merge (squash)
August 11, 2026 21:09
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.