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.82k stars 120 forks source link

IncorrectConfiguration failure is transient #1276

Open eygraber opened 1 month ago

eygraber commented 1 month ago

Running ./gradlew buildHealth yields:

> Advice for :design:icons
  These transitive dependencies should be declared directly:
    api(libs.compose.ui)
    implementation(libs.compose.ui.graphics)
    implementation(libs.compose.ui.unit)

I then add them, but use implementation for all of them, then run ./gradlew buildHealth again, and it passes.

Here is the output of reason before adding the dependencies:

----------------------------------------
You asked about the dependency 'androidx.compose.ui:ui:1.7.2 (libs.compose.ui)'.
You have been advised to add this dependency to 'api'. It matched a bundle rule: androidx.compose.ui:ui:1.7.2 (libs.compose.ui) was substituted for androidx.compose.ui:ui-android:1.7.2.
----------------------------------------

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugCompileClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugRuntimeClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugUnitTestCompileClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugUnitTestRuntimeClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugAndroidTestCompileClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugAndroidTestRuntimeClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseCompileClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseRuntimeClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseUnitTestCompileClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseUnitTestRuntimeClasspath:
:design:icons
\--- androidx.compose.material:material-icons-core:1.7.2
      \--- androidx.compose.material:material-icons-core-android:1.7.2
            \--- androidx.compose.ui:ui:1.7.2

Source: devDebug, main
----------------------
(no usages)

Source: devRelease, main
------------------------
(no usages)

Source: devDebug, test
----------------------
(no usages)

Source: devRelease, test
------------------------
(no usages)

Source: devDebug, android_test
------------------------------
(no usages)

And here's the output after adding them all as implementation:

----------------------------------------
You asked about the dependency 'androidx.compose.ui:ui:1.7.2 (libs.compose.ui)'.
There is no advice regarding this dependency.
----------------------------------------

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugCompileClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugRuntimeClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugUnitTestCompileClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugUnitTestRuntimeClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugAndroidTestCompileClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devDebugAndroidTestRuntimeClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseCompileClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseRuntimeClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseUnitTestCompileClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Shortest path from :design:icons to androidx.compose.ui:ui:1.7.2 (libs.compose.ui) for devReleaseUnitTestRuntimeClasspath:
:design:icons
\--- androidx.compose.ui:ui:1.7.2

Source: devDebug, main
----------------------
(no usages)

Source: devRelease, main
------------------------
(no usages)

Source: devDebug, test
----------------------
(no usages)

Source: devRelease, test
------------------------
(no usages)

Source: devDebug, android_test
------------------------------
(no usages)

Plugin version 2.1.1

Gradle version 8.10.2

JDK version 22

Kotlin and Kotlin Gradle Plugin (KGP) version 2.0.20

Android Gradle Plugin (AGP) version 8.7.0

autonomousapps commented 1 month ago

Can you try the latest version?

eygraber commented 1 month ago

Same behavior. I also don't get any IncorrectConfiguration failures when changing the artifacts that should be implementation to api.

autonomousapps commented 1 month ago

Do you have a reproducer?

eygraber commented 1 month ago

Not shareable. I'll try to make an MRE when I have some free time.