gradle - 在 Gradle 中的任务排序中 mustRunAfter 和 shouldRunAfter 之间有什么区别?

标签 gradle android-gradle-plugin

我对 shouldRunAfter 中的时间和哪一个有疑问和 mustRunAfter在 gradle 中订购任务时应该使用。

最佳答案

这一切都记录得很好,请看 here .尤其:

When you use the “must run after” ordering rule you specify that taskB must always run after taskA, whenever both taskA and taskB will be run. This is expressed as taskB.mustRunAfter(taskA). The “should run after” ordering rule is similar but less strict as it will be ignored in two situations. Firstly if using that rule introduces an ordering cycle. Secondly when using parallel execution and all dependencies of a task have been satisfied apart from the “should run after” task, then this task will be run regardless of whether its “should run after” dependencies have been run or not. You should use “should run after” where the ordering is helpful but not strictly required.



编辑
我也鼓励你阅读 this邮政。

关于gradle - 在 Gradle 中的任务排序中 mustRunAfter 和 shouldRunAfter 之间有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36794690/

相关文章:

java - 使用 Gradle/Java8 构建时存储某些类的方法参数名称

spring - 如何在Groovy中使用<mvc:resource/>

java - 如何防止 jar 在构建过程中多次编译

android - 使用Gradle Android插件收集依赖项

android - 找不到名称为 'default' 的配置。安卓工作室

android - 带 Lint 的StackOverflowError

gradle - Gradle属性在扩展容器封闭中不可见

android - 错误 aapt : Attribute "font" already defined with incompatible format. 此处定义的原始属性

android - 在执行测试之前,如何要求gradlew卸载应用程序?

Android Gradle - 在哪里添加 "android.debug.obsoleteApi=true"