Skip to content

Avoid resolving unused R8 dependency#2101

Merged
Goooler merged 10 commits into
mainfrom
g/20260714/fix-issue-2099
Jul 14, 2026
Merged

Avoid resolving unused R8 dependency#2101
Goooler merged 10 commits into
mainfrom
g/20260714/fix-issue-2099

Conversation

@Goooler

@Goooler Goooler commented Jul 14, 2026

Copy link
Copy Markdown
Member

Closes #2099.


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

Goooler added 7 commits July 14, 2026 21:31
```
1 problem was found storing the configuration cache.
- Task `:server:shadowJar` of type `com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar`: error writing value of type 'org.gradle.api.internal.provider.BiProvider'

See the complete report at file:///private/var/folders/2m/bd7g5fjj4b35fqvp1msqsk740000gn/T/junit-881383515820473092/build/reports/configuration-cache/5zeq7sysso34nq7c1l5z638p6/9iveovp987svtkmp66pbpo78m/configuration-cache-report.html

[Incubating] Problems report is available at: file:///private/var/folders/2m/bd7g5fjj4b35fqvp1msqsk740000gn/T/junit-881383515820473092/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Configuration cache state could not be cached: field `provider` of `org.gradle.internal.serialize.codecs.core.ProviderBackedFileCollectionSpec` bean found in field `r8Classpath` of task `:server:shadowJar` of type `com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar`: error writing value of type 'org.gradle.api.internal.provider.BiProvider'
> Cannot mutate the state of configuration ':server:shadowR8' after the configuration was resolved. After a configuration has been observed, it should not be modified.
```

This reverts commit d8d19b8.
…60714/fix-issue-2099

# Conflicts:
#	src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt
#	src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt

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 addresses issue #2099 by preventing the shadowR8 dependency from being resolved during “lock all configurations” workflows unless R8 minimization is actually enabled, avoiding resolution failures in environments without Google’s Maven repository.

Changes:

  • Make the shadowR8 configuration non-resolvable by default to avoid incidental resolution during dependency locking.
  • Lazily re-enable resolution of shadowR8 only when ShadowJar is configured to use R8 minimization.
  • Add a functional test covering dependency locking with lockAllConfigurations(), and update the Unreleased changelog.

Reviewed changes

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

File Description
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt Lazily marks shadowR8 resolvable only when R8 minimization is enabled.
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowBasePlugin.kt Registers shadowR8 as non-resolvable by default to avoid unwanted resolution.
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/JavaPluginsTest.kt Adds regression test ensuring R8 is not resolved/locked when locking all configurations.
docs/changes/README.md Documents the fix in the Unreleased “Fixed” section.

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

@Goooler Goooler force-pushed the g/20260714/fix-issue-2099 branch from abd0d63 to 969fe5f Compare July 14, 2026 15:35
@Goooler Goooler enabled auto-merge (squash) July 14, 2026 15:38
@Goooler Goooler merged commit b590819 into main Jul 14, 2026
8 checks passed
@Goooler Goooler deleted the g/20260714/fix-issue-2099 branch July 14, 2026 15:51
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.

Introduction of r8 dependency causes resolution issues

2 participants