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

Commit 214b27e

Browse files
committed
Add ability to choose configuration
1 parent 0c41a96 commit 214b27e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

bin/quick-install-dependencies

+14-8
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,24 @@ set -e
66

77
show_help() {
88
cat <<-EOS
9-
Usage: quick-install-dependencies [-h] [-f] <SDK>
9+
Usage: quick-install-dependencies [-h] [-d] [-f] <SDK>
1010
1111
Options:
1212
-h, --help Show this help and exit
13+
-d, --debug Build with Debug configuration [default: release]
1314
-f, --force Force build ignoring cache
1415
1516
Arguments:
1617
SDK Specify SDK to build (macosx|iphoneos|iphonesimulator)
1718
EOS
1819
}
1920

20-
if [ $# -eq 0 -o $# -gt 2 ]; then
21-
echo "error: wrong number of arguments ($# for 1..2)." >&2
21+
if [ $# -eq 0 -o $# -gt 3 ]; then
22+
echo "error: wrong number of arguments ($# for 1..3)." >&2
2223
show_help >&2
2324
exit 1
2425
fi
26+
configuration=Release
2527
force=0
2628
sdk=
2729
carthage_build_dir=
@@ -33,26 +35,30 @@ do
3335
show_help
3436
exit
3537
;;
38+
-d|--debug)
39+
configuration=Debug
40+
shift
41+
;;
3642
-f|--force)
3743
force=1
3844
shift
3945
;;
4046
macosx)
4147
sdk=macosx
4248
carthage_build_dir=Carthage/Build/Mac
43-
release_dir=Release
49+
release_dir="$configuration"
4450
shift
4551
;;
4652
iphoneos)
4753
sdk=iphoneos
4854
carthage_build_dir=Carthage/Build/iOS
49-
release_dir=Release-iphoneos
55+
release_dir="$configuration-iphoneos"
5056
shift
5157
;;
5258
iphonesimulator)
5359
sdk=iphonesimulator
5460
carthage_build_dir=Carthage/Build/iOS
55-
release_dir=Release-iphonesimulator
61+
release_dir="$configuration-iphonesimulator"
5662
shift
5763
;;
5864
'')
@@ -65,7 +71,7 @@ do
6571
esac
6672
done
6773
if [ -z "$sdk" ]; then
68-
echo "error: wrong number of arguments ($# for 1..2)." >&2
74+
echo "error: wrong number of arguments ($# for 1..3)." >&2
6975
show_help >&2
7076
exit 1
7177
fi
@@ -89,7 +95,7 @@ do
8995
xcodebuild build \
9096
-project Carthage/Checkouts/apollo-ios/Apollo.xcodeproj \
9197
-scheme "$scheme" \
92-
-configuration Release \
98+
-configuration "$configuration" \
9399
-derivedDataPath "$derived_data_dir" \
94100
-sdk "$sdk" \
95101
-quiet \

0 commit comments

Comments
 (0)