version: 2 jobs: build: working_directory: ~/code docker: - image: circleci/android:api-28 environment: JVM_OPTS: -XX\:MaxHeapSize\=2048m -Xmx1536m MODULE: touch FLAVOR1: Prod FLAVOR2: NoFree BUILD_TYPE: Release branches: only: - circleCI steps: - checkout - run: name: Setup env command: | echo "export BUILD_TYPE_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${BUILD_TYPE:0:1}${BUILD_TYPE:1})\"" >> $BASH_ENV echo "export FLAVOR1_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR1:0:1}${FLAVOR1:1})\"" >> $BASH_ENV echo "export FLAVOR2_LOWER=\"$(tr '[:upper:]' '[:lower:]' <<< ${FLAVOR2:0:1}${FLAVOR2:1})\"" >> $BASH_ENV - restore_cache: key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }} - run: name: Download Dependencies command: ./gradlew androidDependencies - run: name: Build Touch command: ./gradlew touch:assemble$FLAVOR1_LOWER$FLAVOR2$BUILD_TYPE - run: name: Build Leanback command: ./gradlew Leanback:assemble$FLAVOR1_LOWER$BUILD_TYPE - save_cache: paths: - ~/.gradle key: jars-{{ checksum "build.gradle" }}-{{ checksum "touch/build.gradle" }}-{{ checksum "leanback/build.gradle" }}-{{ checksum "common/build.gradle" }} - store_artifacts: path: touch/build/outputs/apk destination: touch - store_artifacts: path: leanback/build/outputs/apk destination: leanback