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

Bundles work intermittently #904

Closed
shashachu opened this issue May 24, 2023 · 1 comment
Closed

Bundles work intermittently #904

shashachu opened this issue May 24, 2023 · 1 comment

Comments

@shashachu
Copy link

This may be user error, but I can't see what I'm doing incorrectly.

Plugin version
1.2.0

Gradle version
7.4.1

(Optional) Android Gradle Plugin (AGP) version
7.3.0

reason output for bugs relating to incorrect advice
n/a

Describe the bug
We apply a couple of 'common' dependencies in a convention plugin. Most but not all of our modules use it, so I'd like to add them into a bundle and exclude the bundle at the top level.

e.g.

dependencyAnalysis {
    dependencies {
        bundle('library-plugin') { // This doesn't work
            includeDependency('androidx.annotation:annotation')
            includeDependency('javax.inject:javax.inject')
        }
    }
}

issues {
        all {
            onUnusedDependencies {
                exclude('library-plugin')
            }
        }
}

Expected behavior
No advice re those dependencies, but it's still being reported as unused:

> Unused dependencies which should be removed:
    implementation 'androidx.annotation:annotation:1.6.0'

If I exclude the androidx.annotation dependency directly in the all block, it correctly is suppressed.

Additional context
Other bundles are working properly.

@shashachu
Copy link
Author

Actually, it looks like I'm misinterpreting how bundles are meant to be used. This is more like a feature request than a bug, where I'd like to more easily ignore a group of dependencies, but they may or may not be used as a group.

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