mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix eslint Fix flow Revert "Improve Flow Types" This reverts commitbee33a4400. [0.50.0-rc.1] Bump version numbers Fix Analyze step Remove mockFs dependency and unblock tests Revert "[0.50.0-rc.1] Bump version numbers" This reverts commit 5d0bc1d29bfdce40bbcc403190b06324557e5a58. Revert "Migrate to Circle 2.0" This reverts commit8fa9984b11. Remove old circle Comment out danger for now
42 lines
1.1 KiB
Bash
42 lines
1.1 KiB
Bash
# inspired by https://github.com/Originate/guide/blob/master/android/guide/Continuous%20Integration.md
|
|
|
|
function getAndroidSDK {
|
|
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH"
|
|
|
|
DEPS="$ANDROID_HOME/installed-dependencies"
|
|
|
|
if [ ! -e $DEPS ]; then
|
|
echo y | android update sdk --no-ui --all --filter extra-android-m2repository
|
|
echo no | android create avd -n testAVD -f -t android-19 --abi default/armeabi-v7a &&
|
|
touch $DEPS
|
|
fi
|
|
}
|
|
|
|
function waitForAVD {
|
|
local bootanim=""
|
|
export PATH=$(dirname $(dirname $(which android)))/platform-tools:$PATH
|
|
until [[ "$bootanim" =~ "stopped" ]]; do
|
|
sleep 5
|
|
bootanim=$(adb -e shell getprop init.svc.bootanim 2>&1)
|
|
echo "emulator status=$bootanim"
|
|
done
|
|
}
|
|
|
|
function retry3 {
|
|
local n=1
|
|
local max=3
|
|
local delay=1
|
|
while true; do
|
|
"$@" && break || {
|
|
if [[ $n -lt $max ]]; then
|
|
((n++))
|
|
echo "Command failed. Attempt $n/$max:"
|
|
sleep $delay;
|
|
else
|
|
echo "The command has failed after $n attempts." >&2
|
|
return 1
|
|
fi
|
|
}
|
|
done
|
|
}
|