Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more config parameters for android_build #34

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ workflows:
- rn/android_build:
name: build_android_release
project_path: "android"
build_type: release
assemble_build_type: assembleRelease
assemble_test_type: assembleAndroidTest
test_build_type: release
max_workers: 2
requires:
- analyse_js
- rn/android_test:
Expand Down
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 variant to build. This is normally "assembleAndroidTest" but you may have custom build variants 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
21 changes: 18 additions & 3 deletions src/jobs/android_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@ parameters:
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 variant to build. This is normally "assembleAndroidTest" but you may have custom build variants 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"
on_after_initialize:
Expand All @@ -57,7 +69,10 @@ steps:
command: <<parameters.on_after_initialize>>
- android_build:
project_path: <<parameters.project_path>>
build_type: <<parameters.build_type>>
assemble_build_type: <<parameters.assemble_build_type>>
assemble_test_type: <<parameters.assemble_test_type>>
test_build_type: <<parameters.test_build_type>>
max_workers: <<parameters.max_workers>>
- when:
condition: <<parameters.persist_to_workspace>>
steps:
Expand Down