forked from pinterest/PINRemoteImage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·41 lines (31 loc) · 1.03 KB
/
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
#!/usr/bin/env bash
set -eo pipefail
# **** Update me when new Xcode versions are released! ****
PLATFORM="platform=iOS Simulator,OS=10.1,name=iPhone 7"
SDK="iphonesimulator10.1"
MODE="$1"
function echoHeader() {
echo ""
echo ""
echo $1
echo ""
}
if [[ -z "$MODE" ]] ; then
MODE="all"
fi
if [[ "$MODE" = "lint" || "$MODE" = "all" ]] ; then
echoHeader "Testing CocoaPod configurations"
pod lib lint --allow-warnings
fi
if [[ "$MODE" = "tests" || "$MODE" = "all" ]] ; then
echoHeader "Running unit tests"
pod install --project-directory=Examples/Example
xcodebuild clean test -destination "$PLATFORM" -sdk "$SDK" -workspace Examples/Example/PINRemoteImage.xcworkspace -scheme PINRemoteImage ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO | xcpretty -t; test ${PIPESTATUS[0]} -eq 0
fi
if [[ "$MODE" = "carthage" || "$MODE" = "all" ]] ; then
echoHeader "Testing Carthage build"
carthage update
carthage build --no-skip-current --project-directory PINRemoteImage
fi
echo ""
echo "Finished tests"