ci script

This commit is contained in:
Ari Lazier 2016-01-22 12:15:38 -08:00
parent 707ca1d3c3
commit 2c0a92aa63
2 changed files with 34 additions and 2 deletions

View File

@ -20,10 +20,10 @@ PACKAGER_OUT="packager_out.txt"
function start_packager() function start_packager()
{ {
rm -f $PACKAGER_OUT rm -f $PACKAGER_OUT
sh ./node_modules/react-native/packager/packager.sh | tee packager_out.txt & sh ./node_modules/react-native/packager/packager.sh | tee $PACKAGER_OUT &
while :; while :;
do do
if grep -Fxq "React packager ready." packager_out.txt if grep -Fxq "React packager ready." $PACKAGER_OUT
then then
break break
else else
@ -68,6 +68,37 @@ elif [ "$TARGET" = "react-example" ]; then
xcodebuild -scheme ReactExample -configuration "$CONFIGURATION" -sdk iphonesimulator build $DESTINATION xcodebuild -scheme ReactExample -configuration "$CONFIGURATION" -sdk iphonesimulator build $DESTINATION
popd popd
elif [ "$TARGET" = "react-tests-android" ]; then
pushd react-native/android
./gradlew installarchives
popd
pushd tests/react-test-app
if [ -d ~/Applications/Google\ Chrome.app ]; then
open ~/Applications/Google\ Chrome.app
fi
npm install
start_packager
sh run-android.sh
LOGCAT_OUT="logcat_out.txt"
rm -f $LOGCAT_OUT
adb logcat | tee $LOGCAT_OUT &
while :;
do
if grep -q "FILE WRITTEN!!" $LOGCAT_OUT
then
break
else
echo "Waiting for tests."
sleep 2
fi
done
adb pull /data/data/com.demo/files/tests.xml .
else else
echo "Invalid target '${TARGET}'" echo "Invalid target '${TARGET}'"
fi fi

View File

@ -8,6 +8,7 @@
"dependencies": { "dependencies": {
"react-native": "^0.18.0-rc", "react-native": "^0.18.0-rc",
"react-native-fs": "^1.1.0", "react-native-fs": "^1.1.0",
"xmlbuilder": "^4.2.1",
"realm": "file:../..", "realm": "file:../..",
"realm-tests": "file:../lib" "realm-tests": "file:../lib"
} }