Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain inhertited dependencies in the resolution logic #423

Closed
sschuberth opened this issue Sep 8, 2020 · 0 comments
Closed

Retain inhertited dependencies in the resolution logic #423

sschuberth opened this issue Sep 8, 2020 · 0 comments

Comments

@sschuberth
Copy link
Collaborator

@sschuberth Looking at the kotlin plugin, it checks in the allDependencies if inherited,

https://github.com/JetBrains/kotlin/blob/07aee8831eb45690053028f39f3312e1c8e90f69/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/KotlinDependenciesManagement.kt#L131-L136

It appears that if I change our resolution logic from clearing them as,

Configuration copy = configuration.copyRecursive().setTransitive(false)
// https://github.com/ben-manes/gradle-versions-plugin/issues/127
if (copy.metaClass.respondsTo(copy, "setCanBeResolved", Boolean)) {
copy.setCanBeResolved(true)
}
copy.dependencies.clear()
copy.dependencies.addAll(latest)

to retaining those inherited as,

def all = new ArrayList(configuration.getAllDependencies())
all.removeAll(configuration.dependencies)

copy.dependencies.clear()
copy.dependencies.addAll(all)
copy.dependencies.addAll(latest)

Then the failure messages to resolve those configurations goes away,

> Task :dependencyUpdates
Failed to resolve :cli:implementation
Failed to resolve :model:implementation
Failed to resolve :utils:implementation

Originally posted by @ben-manes in #334 (comment)

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

No branches or pull requests

1 participant