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

Missing dependencies #128

Merged
merged 4 commits into from
Mar 6, 2020
Merged

Missing dependencies #128

merged 4 commits into from
Mar 6, 2020

Conversation

caller9
Copy link
Collaborator

@caller9 caller9 commented Mar 6, 2020

Fixes #119

When attempting to call getResolvedArtifacts() on a top level ResolvedConfiguration for an application project that also has library projects an AmbiguousVariantSelectionException will throw. Gradle cannot determine which variant of the library project it should evaluate for artifacts. None of the library project variants lead to artifacts supported by this tool.

This change avoids that by stepping over the library project itself and recursively walking the library project's dependencies. If the library project depends on other library projects, they are avoided in the same way. Once a direct, non-library-project dependency is reached, getAllModuleArtifacts() returns the self-inclusive artifact tree stemming from it.

The result is the set of transitive external dependencies of the application and its library projects.

This also includes separate commits to bump the version and ignore the generated repo folder, fix a logging gap, and enable the use of automatic formatting.

Library projects are ambiguous when attempting to resolve their dependencies. Internally there
are many variants and Gradle will throw a AmbiguousVariantSelectionException when it encounters
this scenario. The result is that a null set of artifacts is returned from getResolvedArtifacts().

This change iterates through the dependency hierarchy's top levels manually to avoid attempting
to automatically traverse a library project. Instead it will manually traverse the tree of library
projects and only automatically traverse non-library dependencies.
Copy link
Collaborator

@jkasnicki jkasnicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jkasnicki jkasnicki merged commit f215771 into master Mar 6, 2020
@caller9 caller9 deleted the missing_dependencies branch March 9, 2020 19:58
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.

dependencies still missing with com.google.android.gms.oss-licenses-plugin:0.10.1
2 participants