[Jetpack Compose / Android] How to separate assembling your application file

Android

Prerequisites

You already defined productFlavor in your module level build.gradle.kts.

    productFlavors {
        create("development") {
            applicationIdSuffix = ".development"
        }
        create("stating") {
            applicationIdSuffix = ".staging"
        }
        create("production") {

        }
    }

How to do

Only you have to remember is two concepts.

  1. The following command will build as app type and flavor
./gradlew assemble<Flavor><BuildType>
  1. If you want to check what command are you available
./gradlew tasks --all

When I want to build Staging as flavor, debug as type you can execute the following command.

./gradlew assembleStagingDebug 

コメント

タイトルとURLをコピーしました