2

I am trying to use Gradle dependencyInsight to find the test dependencies for an android project. I came across this answer which works well for the production code, https://stackoverflow.com/a/61530873/2231099 , however I can't find the configuration for test and androidTest dependencies. We have variants and flavour and this is how I can get the dependencies of debug app in base project,

gradle :base:dependencyInsight --dependency okhttp3 --configuration prodDebugCompileClasspath

I also checked java plugin test configuration setup but can't derive the android use case from this, https://docs.gradle.org/5.2.1/userguide/java_library_plugin.html?#sec:java_library_configurations_graph

I tried something like prodDebugTestCompileClasspath to no avail,

gradle :base:dependencyInsight --dependency okhttp3 --configuration prodDebugTestCompileClasspath

Any suggestions for what the configuration look like for the test and androidTest?

Sushant
  • 440
  • 3
  • 8

1 Answers1

1

Listing the configurations with flags like

gradlew projects --info

and with task bodies like

configurations.each { println it.name } 

don't work anymore.

However you can run

gradlew app:dependencies --scan

This will create an online page on scans.gradle.com, if you click on the link at the end, and follow through. On the dependencies tab you will find all your configurations as well.

In your case the relevant configurations were probably prodDebugUnitTestCompileClasspath and prodDebugAndroidTestCompileClasspath.

Herrbert74
  • 2,578
  • 31
  • 51