From 39b9f785a046c0752845d420ab24acd1f6599d69 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 21 May 2016 09:34:23 -0700 Subject: [PATCH] Document variant dependencies. --- plug-ins/index.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plug-ins/index.html b/plug-ins/index.html index 97ed0e1..8ee9956 100644 --- a/plug-ins/index.html +++ b/plug-ins/index.html @@ -180,7 +180,7 @@ BUILD SUCCESSFUL (0 seconds)
  • The build type.
  • - Product flavors usually contains different source files and different logic (e.g. a "free version" and a "pro version". Build types lead to different archives (e.g. "debug" and "release", with the "release" version being obfuscated). This effect is achieved by defining identical source files in different directories and then letting Kobalt build the correct one. Each product flavor and build type has a name which translates directory into a source directory. For example: + Product flavors usually contain different source files and different logic (e.g. a "free version" and a "pro version". Build types lead to different archives (e.g. "debug" and "release", with the "release" version being obfuscated). This effect is achieved by defining identical source files in different directories and then letting Kobalt build the correct one. Each product flavor and build type has a name which translates directory into a source directory. For example:

     productFlavor("free") {
    @@ -210,6 +210,17 @@ assembleFreeDebug

    For example, if you define two flavors, "pro" and "free", and two build types, "debug" and "release", four tasks will be added that combine these: "proDebug", "proRelease", "freeDebug" and "freeRelease". If you assemble any of these, an artifact named after that combination will be created, e.g. "kobalt-0.273-free-debug.jar".

    +

    + Variants can have they own dependencies{} section, which will be used only if this specific + variant is being compiled or assembled: +

    +
    +    productFlavor("debug") {
    +        dependencies {
    +            compile("joda-time:joda-time:2.9.3")
    +        }
    +    }
    +

    BuildConfig