dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

`reason` task only shows used classes if there are no exposed classes

Open shashachu opened this issue 8 months ago • 3 comments

Plugin version 1.32.0

Gradle version 8.6

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 I'm running the reason task to understand why modules depend on our hairball module. It will only output used classes if there are no exposed classes. Is this intended?

To Reproduce (unfortunately I have to redact specific class/module information) With an exposed class:

$ ./gradlew :feature-library:xxx:reason --id :hairball

> Task :feature-library:xxx:reason

----------------------------------------
You asked about the dependency ':hairball'.
You have been advised to change this dependency to 'api' from 'implementation'.
----------------------------------------

<clip>

Source: debug, main
-------------------
* Exposes 1 class: com.pinterest.hairball.xyz (implies api).

When I comment out the usage of the exposed class:

$ ./gradlew :feature-library:xxx:reason --id :hairball

> Task :feature-library:xxx:reason

----------------------------------------
You asked about the dependency ':hairball'.
There is no advice regarding this dependency.
----------------------------------------

<clip>

Source: debug, main
-------------------
* Uses 11 classes, 5 of which are shown: com.pinterest.xxx ... <clipped>

Expected behavior I'd like to use this task to prioritize classes to pull out of our hairball module, but without complete information it's difficult. Is there a way to make the reason task print out everything?

shashachu avatar Jun 06 '24 16:06 shashachu