Explicitly opt-in to building Android module

Fixes #277
This commit is contained in:
Scott Kyle 2016-03-02 15:47:51 -08:00
parent 27073a9e66
commit 401b501aab
5 changed files with 11 additions and 10 deletions

View File

@ -5,7 +5,8 @@ set -e
PATH="/opt/android-sdk-linux/platform-tools:$PATH" PATH="/opt/android-sdk-linux/platform-tools:$PATH"
npm install realm # Inform the prepublish script to build Android modules.
REALM_BUILD_ANDROID=1 npm install realm
adb reverse tcp:8081 tcp:8081 adb reverse tcp:8081 tcp:8081

View File

@ -5,7 +5,8 @@ set -e
PATH="/opt/android-sdk-linux/platform-tools:$PATH" PATH="/opt/android-sdk-linux/platform-tools:$PATH"
npm install realm # Inform the prepublish script to build Android modules.
REALM_BUILD_ANDROID=1 npm install realm
adb reverse tcp:8081 tcp:8081 adb reverse tcp:8081 tcp:8081

View File

@ -5,9 +5,7 @@ set -o pipefail
cd "$(dirname "$0")/.." cd "$(dirname "$0")/.."
if [ -n "$SKIP_ANDROID_BUILD" -o -n "$XCODE_VERSION_ACTUAL" ]; then if [ -n "$REALM_BUILD_ANDROID" ]; then
echo 'Skipped building Android module'
else
rm -rf android rm -rf android
(cd react-native/android && ./gradlew publishAndroid) (cd react-native/android && ./gradlew publishAndroid)
fi fi

View File

@ -12,7 +12,10 @@ SRCROOT=$(cd "$(dirname "$0")/.." && pwd)
# Start current working directory at the root of the project. # Start current working directory at the root of the project.
cd "$SRCROOT" cd "$SRCROOT"
if [[ $TARGET != *-android ]]; then if [[ $TARGET = *-android ]]; then
# Inform the prepublish script to build Android modules.
export REALM_BUILD_ANDROID=1
else
while pgrep -q Simulator; do while pgrep -q Simulator; do
# Kill all the current simulator processes as they may be from a # Kill all the current simulator processes as they may be from a
# different Xcode version # different Xcode version
@ -22,9 +25,6 @@ if [[ $TARGET != *-android ]]; then
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"

View File

@ -5,7 +5,8 @@ set -e
PATH="/opt/android-sdk-linux/platform-tools:$PATH" PATH="/opt/android-sdk-linux/platform-tools:$PATH"
npm install realm realm-tests # Inform the prepublish script to build Android modules.
REALM_BUILD_ANDROID=1 npm install realm realm-tests
cp ../../src/object-store/tests/query.json node_modules/realm-tests/query-tests.json cp ../../src/object-store/tests/query.json node_modules/realm-tests/query-tests.json