android - 在Gradle上运行任务时,如何调查将要运行的其他任务?

标签 android gradle android-gradle-plugin

在Android项目中,每次我运行./gradlew assemble。 Gradle将运行以下任务:

  • :app:preBuild
  • :app:preDebugBuild
  • :app:checkDebugManifest

  • 等等..

    有没有办法知道每次我运行gradle任务时都会运行的任务列表?

    也许有一个gradle命令,或者另一个选择是在继续显示任务名称的同时使每个任务输出静音。

    最佳答案

    您的用例有一个称为Dry-Run的功能:

    4.8 Dry-Run

    Sometimes you are interested in which tasks are executed in which order for a given set of tasks specified on the command line, but you don't want the tasks to be executed. You can use the -m option for this. For example, if you run gradle -m clean compile, you'll see all the tasks that would be executed as part of the clean and compile tasks. This is complementary to the tasks task, which shows you the tasks which are available for execution.

    关于android - 在Gradle上运行任务时,如何调查将要运行的其他任务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45879412/

    相关文章:

    android - 使用 Android 创建 ZIP 文件

    Android Studio 2.0 Gradle 错误

    java - 由 : java. lang.NoClassDefFoundError: Class not found using the boot class loader 引起;没有可用的堆栈跟踪

    android - Square Otto 事件总线 - 如何使用 junit 和 robolectric 测试发布和订阅

    android - 我不小心从 android studio 中的 import from gradle 选项导入了项目。现在我的项目不工作

    android - 我们可以使用自定义形状 API 在 Android 中创建像 iOS 一样的后退按钮吗

    Android Studio 警告新版本库可用,但不存在

    java - Beans和RabbitTemplate/RabbitHealth出现TomcatStarter错误

    android - 在离线模式下使用 Gradle 在 Redhat 中构建 Android APK

    Android 单元测试支持在 android 库模块中不起作用