Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Flavor Specific Dependency Tree

My Android app has a number of flavors: Production, Staging, Review, etc. as well as Release and Debug build types. When I run ./gradlew app:dependencies it naturally returns a dependency tree with each flavor/build type:

  • productionRelease
  • productionDebug
  • stagingRelease
  • stagingDebug
  • etc.

This results in a dependency tree with over 32000 lines, making it a bit difficult to evaluate. What I'm looking for is a dependency command where I can specify the flavor and build type to avoid having a monstrous dependency tree report, something like:

./gradlew app:stagingDebugDependencies

Any help, tips and or hints are greatly appreciated.

like image 367
hopeman Avatar asked Jun 07 '26 01:06

hopeman


1 Answers

You can get the dependecy tree for a particular flavor and build type combination by running:

./gradlew app:dependencies --configuration <flavorAndBuildType><classpath>

Classpath can be either RuntimeClasspath or CompileClasspath depending on if you're interested in compiletime or runtime dependencies.

An example of getting the runtime dependency tree for the paid version of an app, hitting the production servers and building it for debug would be:

./gradlew app:dependencies --configuration paidProdDebugRuntimeClasspath
like image 160
Daniel Avatar answered Jun 09 '26 05:06

Daniel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!