autonomousapps / autonomousapps/dependency-analysis-gradle-plugin

How to avoid using dependencyAnalysys lambda in each build.gradle file

Open
#1,342 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Kotlin
Stars
2.2k
Forks
158
Avg merge
16h 25m
Merged PRs (30d)
46

Description

I'm actively using this plugin and we have move than 1k modules in the project. Each module has its own whitelisted dependencies which I have to add to dependencyAnalysis -> exclude block. It would be nice to have one whitelist file with all modules and all excludes and avoid using this dependencyAnalysis block in each module. What are recommendations here?
Example of current usage:

_module1: build.gradle.kts_

```
dependencyAnalysis {
val fail = "fail"
val ignore = "ignore"
issues {
onUnusedDependencies {
severity(fail)
exclude(
":somemodule1:deps1",
libs.dagger.android.support.map { it.name() }.get(),
"",
)
}
onUsedTransitiveDependencies { severity(ignore) }
onIncorrectConfiguration { severity(ignore) }
onCompileOnly { severity(ignore) }
onRuntimeOnly { severity(ignore) }
onUnusedAnnotationProcessors { severity(ignore) }
onRedundantPlugins { severity(ignore) }
}
}
```

Nice to have:

_unused-deps-whitelist.txt_

```
module1 {
":somemodule1:deps1",
libs.dagger.android.support.map { it.name() }.get(),
},
module2 {
":somemodule2:deps2",
libs.dagger.android.support.map { it.name() }.get(),
}
```

Contributor guide

Open the contributing guide

Research direction

Review the dependencyAnalysis configuration shown in the module build.gradle.kts files and the proposed unused-deps-whitelist.txt structure. Determine whether one project-level whitelist can preserve module-specific exclusions without repeating each block; done means all modules use the shared exclusions. No implementation file or test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.