This topic created in 1336 days ago, the information mentioned may be changed or developed.
想用编写 gralde 脚本批量执行多个 gradle 任务,从而生成多个渠道包
例如按顺序执行以下几个任务,应该如何编写 graldle 脚本代码呢?
assembleProduction1Release
assembleProduction2Release
assembleProduction3Release
assembleProduction4Release
assembleProduction5Release
5 replies • 2022-10-23 20:55:29 +08:00
 |
|
1
hu8245 Oct 20, 2022
白嫖啊?直接看 groovy 语法啊
|
 |
|
2
rb6221 Oct 20, 2022
这不是 shell 脚本的事么,直接执行 gradlew assembleProduction1Release 这个命令啊。有几个你就执行几个。跟 gradle 脚本没关系吧
|
 |
|
3
300 Oct 20, 2022 via Android
直接写个脚本文件不就行了 cmd 或者 shell 里 ./gradlew assemble1
|
 |
|
4
XXWHCA Oct 20, 2022
如果你的 product 就这几个,你可以直接运行./gradlew assembleRelease 如果是只需要运行着 5 个 product ,那就在后面拼接就行了,gradle 会按顺序执行的,./gradlew assembleProduction1Release assembleProduction2Release assembleProduction3Release ...
|
 |
|
5
yuanxiaosong Oct 23, 2022
task assembleProduction1Release(type: Copy) { } assemble.finalizedBy(assembleProduction1Release)
task assembleProduction2Release(type: Copy) { } assembleProduction1Release.finalizedBy(assembleProduction2Release)
……
|