Skip building Android module for iOS tests

This commit is contained in:
Scott Kyle 2016-02-11 13:21:15 -08:00
parent 291cd98701
commit 69f0241adb
3 changed files with 18 additions and 1 deletions

View File

@ -14,6 +14,6 @@
], ],
"scripts": { "scripts": {
"test": "scripts/test.sh", "test": "scripts/test.sh",
"prepublish": "rm -rf android && cd react-native/android && ./gradlew publishAndroid" "prepublish": "scripts/prepublish.sh"
} }
} }

13
scripts/prepublish.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
set -e
set -o pipefail
cd "$(dirname "$0")/.."
if [ -n "$SKIP_ANDROID_BUILD" ]; then
echo 'Skipped building Android module'
else
rm -rf android
(cd react-native/android && ./gradlew publishAndroid)
fi

View File

@ -20,7 +20,11 @@ if [[ $TARGET != *-android ]]; then
# CoreSimulatorService doesn't exit when sent SIGTERM # CoreSimulatorService doesn't exit when sent SIGTERM
pkill -9 Simulator 2>/dev/null || true pkill -9 Simulator 2>/dev/null || true
done done
DESTINATION="-destination id=$(xcrun simctl list devices | grep -v unavailable | grep -m 1 -o '[0-9A-F\-]\{36\}')" DESTINATION="-destination id=$(xcrun simctl list devices | grep -v unavailable | grep -m 1 -o '[0-9A-F\-]\{36\}')"
# Inform the prepublish script to skip building Android modules.
export SKIP_ANDROID_BUILD=1
fi fi
PACKAGER_OUT="$SRCROOT/packager_out.txt" PACKAGER_OUT="$SRCROOT/packager_out.txt"