Gradle Build only a flavour

后端 未结 4 2045
迷失自我
迷失自我 2020-12-02 06:47

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 ex

4条回答
  •  感情败类
    2020-12-02 07:19

    I would simplify the answer given by @CommonsWare because going through the answer i was litte confused.

    Consider these are the product flavours

    • Dev
    • Preprod
    • Prod

    Run

    gradlew task

    This will list out all Product flavours along with there build types

    assemble - Assembles all variants of all applications and secondary packages.
    assembleAndroidTest - Assembles all the Test applications.
    assembleDebug - Assembles all Debug builds.
    assembleDEV - Assembles all DEV builds.
    assemblePREPROD - Assembles all PREPROD builds.
    assemblePROD - Assembles all PROD builds.
    assembleRelease - Assembles all Release builds.
    

    From this you can easily choose the flavours and will generate a build based on that

    gradlew assemblePREPROD

提交回复
热议问题