Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit c721671

Browse files
author
Will Anderson
committed
Update build scripts to run more robustly using xctool
1 parent 27448cb commit c721671

File tree

5 files changed

+59
-6
lines changed

5 files changed

+59
-6
lines changed

scripts/build-and-test.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SCRIPTS_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
6+
7+
ROOT=$1
8+
XCODEPROJ=$2
9+
XCODESCHEME=$3
10+
11+
export REACT_PACKAGER_LOG="$ROOT/server.log"
12+
13+
cd $ROOT
14+
15+
function cleanup {
16+
EXIT_CODE=$?
17+
set +e
18+
19+
sleep 3
20+
$SCRIPTS_PATH/stop-packager.sh
21+
22+
if [ $EXIT_CODE -ne 0 ];
23+
then
24+
WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log
25+
#[ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS
26+
27+
#[ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG
28+
fi
29+
}
30+
trap cleanup EXIT
31+
32+
#$SCRIPTS_PATH/stop-packager.sh
33+
$SCRIPTS_PATH/start-packager.sh $ROOT
34+
35+
xctool \
36+
-project $XCODEPROJ \
37+
-scheme $XCODESCHEME -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=8.3' \
38+
build
39+
40+
xctool \
41+
-project $XCODEPROJ \
42+
-scheme $XCODESCHEME -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=8.3' \
43+
test
44+
45+

scripts/start-packager.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
$ROOT=$1
4+
5+
command=`node -e "console.log(require('./package').scripts.start)"`
6+
$command &

scripts/stop-packager.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
result=`lsof -t -i4TCP:8081`
3+
4+
if [ $result ]
5+
then
6+
kill -9 `lsof -t -i4TCP:8081`
7+
fi
8+

start-packager.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

stop-packager.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)