摇篮建立只是一个味道 [英] Gradle Build only a flavour

查看:126
本文介绍了摇篮建立只是一个味道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能告诉我,如果有可能通过命令行来只是我的不同风格中的一种建立?

Could someone tell me if it's possible to build only one of my different flavors through the command-line?

目前我还没有看到执行方式的时刻,例如:

At the moment I haven't seen the way to execute, for example:

gradle buildDev 

在开发是我的不同口味之一。事实上,我必须执行:

when Dev is one of my different flavors. Indeed, I have to execute:

gradle build

和所有的口味都构建。

And all flavors are build.

我想跳过一些味道。 这可能吗?

I'd like to skip some flavors. is it possible?

感谢

推荐答案

虽然是没有味道的特定版本的建立的任务,也有味道,特定版本在组装安装任务。 组装将创建APK; 安装将在设备/仿真器进行安装。

While there is no flavor-specific version of the build task, there are flavor-specific versions of the assemble and install tasks. assemble will create the APK; install will install it on devices/emulators.

例如,在此示例项目,我定义了两个产品的口味(巧克力香草)和三个总生成类型(调试发布夹层)。

For example, in this sample project, I define two product flavors (chocolate and vanilla) and three total build types (debug, release, and mezzanine).

运行 摇篮任务 节目,其中包括:

Running gradle tasks shows, among others:

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

这篇关于摇篮建立只是一个味道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆