Android Flavor 特定的依赖树 [英] Android Flavor Specific Dependency Tree
问题描述
我的 Android 应用有多种风格:生产、暂存、审核等以及发布strong> 和 Debug 构建类型.当我运行 ./gradlew app:dependencies
时,它自然会返回一个具有每种风格/构建类型的依赖树:
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:
- 生产发布
- 生产调试
- 暂存发布
- 登台调试
- 等
这导致依赖树超过 32000 行,这使得评估有点困难.我正在寻找的是一个依赖命令,我可以在其中指定风格和构建类型以避免出现可怕的依赖树报告,例如:
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.
推荐答案
您可以通过运行以下命令获取特定风格和构建类型组合的依赖树:
You can get the dependecy tree for a particular flavor and build type combination by running:
./gradlew app:dependencies --configuration <flavorAndBuildType><classpath>
Classpath 可以是 RuntimeClasspath 或 CompileClasspath,具体取决于您是否对编译时或运行时依赖项感兴趣.
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
这篇关于Android Flavor 特定的依赖树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!