forked from swiftlang/swift-corelibs-foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xcode-build.sh
executable file
·53 lines (42 loc) · 1.15 KB
/
xcode-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
DERIVED_DATA=xcode-test-build
CLEAN=0
CONFIG=Debug
TEST=0
TESTCASE=""
for i in "$@"
do
case $i in
-h)
echo "usage: $0 [--clean] [--debug|--release] [--test]"
exit 0
;;
--clean)
CLEAN=1
;;
--debug)
CONFIG=Debug
;;
--release)
CONFIG=Release
;;
--test)
TEST=1
;;
*)
TESTCASE="$i"
break
;;
esac
done
if [ $CLEAN = 1 ]; then
echo Cleaning
rm -rf "${DERIVED_DATA}"
fi
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme SwiftFoundation -configuration $CONFIG build || exit 1
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme SwiftFoundationNetworking -configuration $CONFIG build || exit 1
if [ $TEST = 1 ]; then
echo Testing
xcodebuild -derivedDataPath $DERIVED_DATA -workspace Foundation.xcworkspace -scheme TestFoundation -configuration $CONFIG build || exit 1
$DERIVED_DATA/Build/Products/$CONFIG/TestFoundation.app/Contents/MacOS/TestFoundation $TESTCASE
fi