gradle assemble 和 gradle build 任务有什么区别?

What are the differences between gradle assemble and gradle build tasks?(gradle assemble 和 gradle build 任务有什么区别?)
本文介绍了gradle assemble 和 gradle build 任务有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

如果我没记错的话 gradle assemble 确实运行 gradle assembleDebuggradle assembleRelease,但我相信 gradle build 也一样,那么它们两者有什么不同呢?

If I am not wrong gradle assemble does run gradle assembleDebug and gradle assembleRelease, but I believe gradle build also does the same, so what are the different between them both?

推荐答案

assemble 将构建您的工件,而 build 将通过额外检查组装您的工件.

assemble will build your artifacts, and build will assemble your artifacts with additional checks.

build 依赖于 assemble,所以 buildassemble

build depends on assemble, so build is sort of a superset of assemble

您可以使用 --dry-run 标志查看将要执行的任务.例如

You can have a look on the tasks that will be executed by using the --dry-run flag. e.g.

gradlew build --dry-run

你会看到除了assemble之外,linttest也会被执行.

You will see that apart from assemble also lint and test will be executed.

这篇关于gradle assemble 和 gradle build 任务有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)