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

test: reproduces issue 947 #1191

Open autonomousapps opened 1 month ago

autonomousapps commented 1 month ago

https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/947

This test currently fails, producing this erroneous advice:

> Task :buildHealth
Advice for :proj
Unused dependencies which should be removed:
  extraApi 'com.squareup.okio:okio:3.9.0'

DAGP is suggesting removing the dep on the "extra" source-set's dependency. The main source set depends on v3.8.0. This would lead to a compilation error.

github-actions[bot] commented 1 month ago

❌ Test workflow failed:

* Non-functional tests     : https://gradle.com/s/xxwftvdyvbdkm
* TestKit check            : https://gradle.com/s/2uedpqfcogar4
* JVM functional tests     : https://gradle.com/s/uzuc6q7jxo3gi
* Android functional tests : 
* Root buildHealth         : 
* TestKit buildHealth      : 
jjohannes commented 1 month ago

There was a .withSourceSet("extra") missing in the example setup. I am not sure if this reproduces (only) https://github.com/autonomousapps/dependency-analysis-gradle-plugin/issues/947. There seems to be another issue with api vs implementation and multiple source sets.

Right now the test gives no advice, although it should give two. But this also happens if I use com.squareup.okio:okio:3.8.0 (same version) in both dependencies.

github-actions[bot] commented 1 month ago

❌ Test workflow failed:

* Non-functional tests     : https://gradle.com/s/kq4zdik42boug
* TestKit check            : https://gradle.com/s/kaehspxoz36a6
* JVM functional tests     : https://gradle.com/s/6kojtmbwmp7w2
* Android functional tests : 
* Root buildHealth         : 
* TestKit buildHealth      :