Skip to content

Fix the conflicts when using afterEvaluate with other plugins - #2055

Merged
Goooler merged 4 commits into
mainfrom
g/20260622/remove-after-evaluated
Jun 22, 2026
Merged

Fix the conflicts when using afterEvaluate with other plugins#2055
Goooler merged 4 commits into
mainfrom
g/20260622/remove-after-evaluated

Conversation

@Goooler

@Goooler Goooler commented Jun 22, 2026

Copy link
Copy Markdown
Member

Closes #2054.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

@Goooler Goooler changed the title Remove afterEvaluate usages Fix the conflicts when using afterEvaluate with other plugins Jun 22, 2026
@Goooler
Goooler requested a review from Copilot June 22, 2026 04:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes the afterEvaluate-time mutation of the shadowRuntimeElements configuration attributes in ShadowJavaPlugin, to avoid “configuration locked for mutation” conflicts when Shadow is used alongside other plugins (e.g., publishing / Artifactory), and records the fix in the Unreleased changelog.

Changes:

  • Move target JVM attribute computation/setting into the shadowRuntimeElements configuration’s attributes {} block (instead of afterEvaluate).
  • Keep the existing “opt-out” behavior for addTargetJvmVersionAttribute while avoiding late configuration mutation.
  • Add a “Fixed” entry to the Unreleased changelog describing the compatibility fix.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt Removes afterEvaluate attribute mutation and sets the target JVM attribute during configuration registration to prevent locking conflicts.
docs/changes/README.md Adds an Unreleased “Fixed” changelog entry for the conflict/locking fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Goooler
Goooler force-pushed the g/20260622/remove-after-evaluated branch from a61aedb to cba7853 Compare June 22, 2026 05:13
@Goooler
Goooler merged commit edb0f55 into main Jun 22, 2026
5 checks passed
@Goooler
Goooler deleted the g/20260622/remove-after-evaluated branch June 22, 2026 05:14
Goooler added a commit that referenced this pull request Jul 6, 2026
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.

Cannot change attributes of configuration after it has been locked for mutation

2 participants