Fix Gradle 9.4 variant model cycle without GCV workaround#150
Closed
Fix Gradle 9.4 variant model cycle without GCV workaround#150
Conversation
Generate changelog in
|
2 tasks
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
Contributor
Author
|
closed in favour of palantir/gradle-consistent-versions#1614 |
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.
Before this PR
On Gradle 9.4+ with
gradle-consistent-versions, a variant model cycle occurs:This plugin applied
IdeaLanguageInjectorProjectPluginto all projects including the root viaallprojects {}, creating a consumable config on the root project. GCV makes all configs extend itsrootConfiguration(which has aProjectDependencyon root), creating a self-referencing cycle during variant model computation.#149 worked around this with
VersionRecommendationsExtension.excludeConfigurations(...), but that required a compile-time dependency on GCV. See also palantir/gradle-consistent-versions#1614 for the GCV-side fix.After this PR
Fixes the architectural issue: the root project shouldn't have a consumable config since it's the aggregator/consumer.
allprojects {}→subprojects {}so the consumable config is only created on subprojectssourceSetArtifactView()with the artifact transform, bypassing the consumable config entirelyexcludeFromConsistentVersionsworkaround andcompileOnlydependencysourceSetArtifacts/sourceSetArtifactViewinto a single parameterized method