autonomousapps / dependency-analysis-gradle-plugin

Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins
Apache License 2.0
1.66k stars 116 forks source link

Incorrect module structure advice #1206

Open OVOSKOP opened 1 week ago

OVOSKOP commented 1 week ago

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:

  1. Create Android module A
  2. Create Android module B
  3. Create a dependency of module B on module A
  4. Add multiple dependency composites to module B
  5. 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.