Skip to content

Commit

Permalink
Add more config parameters for android_build�
Browse files Browse the repository at this point in the history
Add more parameters to the android_build command. This allows us to be more explicit with our build variants and it terms will save minutes on circleCI by only specifying the build variantes that we really needs

fixes react-native-community#33
  • Loading branch information
compojoom committed Jan 14, 2020
1 parent f9d8bed commit 215c7d5
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/commands/android_build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
description: Builds the Android app at the given path with the given build types. This should be run only after installing dependencies.
description: Builds the Android app at the given path with the given build types. This should be run only after installing dependencies.

parameters:
project_path:
description: The path to the root of the Android project you want to build, relative to the root of the repository.
type: string
default: "./android"
build_type:
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
max_workers:
description: The number of workers to use for a build
type: integer
default: 2
assemble_build_type:
description: The build variant to build. This is normally either "assembleDebug" or "assembleRelease" but you may have custom build variants that you can specify here.
type: string
default: "assembleDebug"
assemble_test_type:
description: The test build varinat to build. This is normally "assembleAndroidTest" but you may have custom build variantes that you can specify here.
type: string
default: "assembleAndroidTest"
test_build_type:
description: The test build type to build. This is normally "debug" or "release".
type: string
default: "debug"

Expand Down Expand Up @@ -59,7 +71,7 @@ steps:

- run:
name: Build Android APK
command: "cd <<parameters.project_path>> && chmod +x gradlew && ./gradlew --build-cache --max-workers 2 --continue assemble<<parameters.build_type>> assembleAndroidTest -DtestBuildType=<<parameters.build_type>> --stacktrace"
command: "cd <<parameters.project_path>> && chmod +x gradlew && ./gradlew --build-cache --max-workers <<parameters.max_workers>> --continue <<parameters.assemble_build_type>> <<parameters.assemble_test_type>> -DtestBuildType=<<parameters.test_build_type>> --stacktrace"

- run:
name: Collecting Gradle Build caches for saving
Expand Down

0 comments on commit 215c7d5

Please sign in to comment.