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

feat: added background to create-avd #65

Merged
merged 3 commits into from
Feb 21, 2023
Merged
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
8 changes: 7 additions & 1 deletion .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ jobs:
command: |
echo "Test"
- android/kill-emulators
- android/create-avd:
avd-name: test3
system-image: system-images;android-27;default;x86
JalexChen marked this conversation as resolved.
Show resolved Hide resolved
install: true
background: true
- run: sleep 15 && echo "should cancel previous command"

test-start-emulator-and-run-tests:
parameters:
Expand Down Expand Up @@ -172,7 +178,7 @@ jobs:
working-directory: ReactNativeCFD/android
- android/fastlane-deploy:
working-directory: ReactNativeCFD/android
lane-name: internal
lane-name: list

workflows:
test-deploy:
Expand Down
28 changes: 14 additions & 14 deletions src/commands/create-avd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ parameters:
type: boolean
description: |
Whether to first install the system image via sdkmanager
background:
type: boolean
description: |
Whether to run the creation command in background
default: false
additional-args:
type: string
default: ""
description: |
Additional args to be passed directly to the avd creation command
steps:
- when:
condition: << parameters.install >>
steps:
- run:
name: Install system image "<< parameters.system-image >>"
command: |
sdkmanager "<< parameters.system-image >>"
- run:
environment:
PARAM_AVD_NAME: << parameters.avd-name >>
PARAM_SYSTEM_IMAGE: << parameters.system-image >>
PARAM_ADDITIONAL_ARGS: << parameters.additional-args >>
name: Create avd "<< parameters.avd-name >>"
command: <<include(scripts/create-avd.sh)>>
- run:
environment:
PARAM_AVD_NAME: << parameters.avd-name >>
PARAM_INSTALL: << parameters.install >>
PARAM_SYSTEM_IMAGE: << parameters.system-image >>
PARAM_ADDITIONAL_ARGS: << parameters.additional-args >>
name: Create avd "<< parameters.avd-name >>"
command: <<include(scripts/create-avd.sh)>>
background: << parameters.background >>
5 changes: 5 additions & 0 deletions src/scripts/create-avd.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/bin/bash

if [ "${PARAM_INSTALL}" == 1 ]; then
sdkmanager "${PARAM_SYSTEM_IMAGE}"
fi

echo "no" | avdmanager --verbose create avd -n ${PARAM_AVD_NAME} -k ${PARAM_SYSTEM_IMAGE} ${PARAM_ADDITIONAL_ARGS}