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

Discrepancies between list of dependencies found by AboutLibrary and the dependencies task #1039

Closed
6 of 10 tasks
redwarp opened this issue Nov 22, 2024 · 1 comment · Fixed by #1040
Closed
6 of 10 tasks

Comments

@redwarp
Copy link
Contributor

redwarp commented Nov 22, 2024

About this issue

Briefly describe the issue

I've noticed that some libraries, that are reported by gradle when running ./gradlew app:dependencies --configuration debugRuntimeClasspath are missing from the report

How can the issue be reproduced / sample code

I'm joining a minimal sample project to reproduce:
MissingLib.zip
It's an app that does nothing but display the list of dependencies using AboutLibraries.

  1. Within the sample project, run ./gradlew app:dependencies --configuration debugRuntimeClasspath
  2. Notice that there are 3 androidx.annotation:annotation libraries:
    • androidx.annotation:annotation
    • androidx.annotation:annotation-jvm
    • androidx.annotation:annotation-experimental
  3. Run ./gradlew app:findLibraries
  4. Notice that there are only 2 of the androidx.annotation:annotation libraries:
    • androidx.annotation:annotation-jvm
    • androidx.annotation:annotation-experimental

Potential fix

I experimented with the plugin, and what should fix it is to modify this line: https://github.com/mikepenz/AboutLibraries/blob/develop/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/DependencyCollector.kt#L129

From:

  else -> {
    if (LOGGER.isDebugEnabled) LOGGER.debug("retrieve allModuleArtifacts from artifact")
    resolvedDependency.allModuleArtifacts
}

to

  else -> {
    if (LOGGER.isDebugEnabled) LOGGER.debug("retrieve allModuleArtifacts from artifact")
    resolvedDependency.allModuleArtifacts + resolvedDependency.toResolvedBomArtifact()
}

It doesn't seem to have any negative side effect to do so, but maybe I'm missing something?

Let me know if I can/should open a merge request.

Details

  •  Used library version: 11.2.3, 12.3.0-rc01
  •  Used support library version
  •  Used gradle build tools version
  •  Used tooling / Android Studio version
  •  Other used libraries, potential conflicting libraries

Checklist

@mikepenz
Copy link
Owner

Thank you very much for the report.

Please open a PR for this adjustment

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 a pull request may close this issue.

2 participants