問題描述
如果我沒記錯的話 gradle assemble
確實運行 gradle assembleDebug
和 gradle 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
之外,lint
和test
也會被執行.
You will see that apart from assemble
also lint
and test
will be executed.
這篇關于gradle assemble 和 gradle build 任務有什么區別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!