本文介绍了gradle组装和gradle构建任务之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我没记错的话,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,所以build有点像assemble

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组装和gradle构建任务之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 05:30