有人可以告诉我是否可以通过命令行仅构建我的不同风格中的一种?
目前我还没有看到执行的方式,例如:
gradle buildDev
当 Dev 是我的不同风格之一。确实,我必须执行:
gradle build
所有的味道都是建立起来的。
我想跳过一些口味。 有可能吗?
谢谢
最佳答案
虽然 build
任务没有特定风格的版本,但 assemble
和 install
任务有特定风格的版本。 assemble
将创建 APK; install
会将其安装在设备/模拟器上。
例如,在 this sample project ,我定义了两种产品风格(chocolate
和 vanilla
)和三种总构建类型(debug
、release
和夹层
)。
运行 gradle tasks
显示,除其他外:
Build tasks
-----------
assemble - Assembles all variants of all applications and secondary packages.
assembleChocolate - Assembles all builds for flavor Chocolate
assembleChocolateDebug - Assembles the Debug build for flavor Chocolate
assembleChocolateDebugTest - Assembles the Test build for the ChocolateDebug build
assembleChocolateMezzanine - Assembles the Mezzanine build for flavor Chocolate
assembleChocolateRelease - Assembles the Release build for flavor Chocolate
assembleDebug - Assembles all Debug builds
assembleMezzanine - Assembles all Mezzanine builds
assembleRelease - Assembles all Release builds
assembleTest - Assembles all the Test applications
assembleVanilla - Assembles all builds for flavor Vanilla
assembleVanillaDebug - Assembles the Debug build for flavor Vanilla
assembleVanillaDebugTest - Assembles the Test build for the VanillaDebug build
assembleVanillaMezzanine - Assembles the Mezzanine build for flavor Vanilla
assembleVanillaRelease - Assembles the Release build for flavor Vanilla
Install tasks
-------------
installChocolateDebug - Installs the Debug build for flavor Chocolate
installChocolateDebugTest - Installs the Test build for the ChocolateDebug build
installChocolateMezzanine - Installs the Mezzanine build for flavor Chocolate
installChocolateRelease - Installs the Release build for flavor Chocolate
installVanillaDebug - Installs the Debug build for flavor Vanilla
installVanillaDebugTest - Installs the Test build for the VanillaDebug build
installVanillaMezzanine - Installs the Mezzanine build for flavor Vanilla
installVanillaRelease - Installs the Release build for flavor Vanilla
uninstallAll - Uninstall all applications.
uninstallChocolateDebug - Uninstalls the Debug build for flavor Chocolate
uninstallChocolateDebugTest - Uninstalls the Test build for the ChocolateDebug build
uninstallChocolateMezzanine - Uninstalls the Mezzanine build for flavor Chocolate
uninstallChocolateRelease - Uninstalls the Release build for flavor Chocolate
uninstallVanillaDebug - Uninstalls the Debug build for flavor Vanilla
uninstallVanillaDebugTest - Uninstalls the Test build for the VanillaDebug build
uninstallVanillaMezzanine - Uninstalls the Mezzanine build for flavor Vanilla
uninstallVanillaRelease - Uninstalls the Release build for flavor Vanilla
关于android - Gradle:如何构建不同构建类型的不同风格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21307444/