From 69f0241adb817e27cd1c5af71111207d680d6987 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 11 Feb 2016 13:21:15 -0800 Subject: [PATCH] Skip building Android module for iOS tests --- package.json | 2 +- scripts/prepublish.sh | 13 +++++++++++++ scripts/test.sh | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 scripts/prepublish.sh diff --git a/package.json b/package.json index 13a6522b..e8c7fc6d 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,6 @@ ], "scripts": { "test": "scripts/test.sh", - "prepublish": "rm -rf android && cd react-native/android && ./gradlew publishAndroid" + "prepublish": "scripts/prepublish.sh" } } diff --git a/scripts/prepublish.sh b/scripts/prepublish.sh new file mode 100755 index 00000000..ab5c03ba --- /dev/null +++ b/scripts/prepublish.sh @@ -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 diff --git a/scripts/test.sh b/scripts/test.sh index 2591088a..d25df2d9 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,7 +20,11 @@ if [[ $TARGET != *-android ]]; then # CoreSimulatorService doesn't exit when sent SIGTERM pkill -9 Simulator 2>/dev/null || true done + 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 PACKAGER_OUT="$SRCROOT/packager_out.txt"