Skip to content

Commit 215c7d5

Browse files
committed
Add more config parameters for android_build�
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
1 parent f9d8bed commit 215c7d5

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/commands/android_build.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
1-
description: Builds the Android app at the given path with the given build types. This should be run only after installing dependencies.
1+
description: Builds the Android app at the given path with the given build types. This should be run only after installing dependencies.
22

33
parameters:
44
project_path:
55
description: The path to the root of the Android project you want to build, relative to the root of the repository.
66
type: string
77
default: "./android"
8-
build_type:
9-
description: The build type to build. This is normally either "debug" or "release" but you may have custom build types configured for your app.
8+
max_workers:
9+
description: The number of workers to use for a build
10+
type: integer
11+
default: 2
12+
assemble_build_type:
13+
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.
14+
type: string
15+
default: "assembleDebug"
16+
assemble_test_type:
17+
description: The test build varinat to build. This is normally "assembleAndroidTest" but you may have custom build variantes that you can specify here.
18+
type: string
19+
default: "assembleAndroidTest"
20+
test_build_type:
21+
description: The test build type to build. This is normally "debug" or "release".
1022
type: string
1123
default: "debug"
1224

@@ -59,7 +71,7 @@ steps:
5971

6072
- run:
6173
name: Build Android APK
62-
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"
74+
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"
6375

6476
- run:
6577
name: Collecting Gradle Build caches for saving

0 commit comments

Comments
 (0)