dependency-analysis-gradle-plugin
dependency-analysis-gradle-plugin copied to clipboard
Incorrect module structure advice
Plugin version 1.32.0
Gradle version 8.4
JDK version 17
(Optional) Kotlin and Kotlin Gradle Plugin (KGP) version 1.9.23
(Optional) Android Gradle Plugin (AGP) version 8.3.2
Describe the bug We have module C, which depends on project android modules A and B, as well as on android compose dependencies.
The report contains advice that module C could be a JVM project.
Module structure advice
This project uses limited Android features and could be a JVM project.
* Has Android library dependencies.
We cannot remove Android dependencies from this module, which means, as far as I understand, we cannot make this module a JVM project. However, the check fails with the advice to change the module structure to the JVM project.
We have temporarily disabled module structure checks:
issues {
all {
onModuleStructure {
severity("ignore")
}
}
}
We have other similar modules in our project, but the reports do not contain similar advice for them.
How can we suppress this particular advice?
To Reproduce Steps to reproduce the behavior:
- Create Android module A
- Create Android module B
- Create a dependency of module B on module A
- Add multiple dependency composites to module B
- Run check on module B
Expected behavior The absence of such advice for modules that cannot get rid of Android dependencies or a clear way to suppress such advice.
Thanks for the issue.
There are two kinds of "module advice" related to this:
This project uses limited Android features and could be a JVM project.This project uses no Android features and should be a JVM project.
What you have is could. The difference is based on a heuristic that gives various Android feature a value and, if the sum of the values reaches a certain threshhold, it trips over from could to should.
The truth is I simply haven't had enough feedback on this feature, which should be considered "incubating" to use Gradle terminology, so I don't know where that line should be. I appreciate this feedback.
I guess usage of the Android resources (R class) could be one clear indicator that this project cannot be a JVM project?
This has been partially mitigated with https://github.com/autonomousapps/dependency-analysis-gradle-plugin/pull/1438.