forked from iZettle/Lift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request iZettle#1 from iZettle/build-script
Add build script and .travis.yml file
- Loading branch information
Showing
2 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
language: objective-c | ||
osx_image: xcode9.1 | ||
env: | ||
global: | ||
- LC_CTYPE=en_US.UTF-8 | ||
- LANG=en_US.UTF-8 | ||
matrix: | ||
- COMMAND="test-iOS" | ||
- COMMAND="test-native" | ||
script: | ||
- set -o pipefail | ||
- xcodebuild -version | ||
- xcodebuild -showsdks | ||
- swift -version | ||
- sh build.sh "$COMMAND" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/sh | ||
|
||
set -o errexit | ||
set -o errtrace | ||
set -o pipefail | ||
|
||
PROJECT="Lift.xcodeproj" | ||
SCHEME="Lift" | ||
|
||
IOS_SDK="iphonesimulator11.1" | ||
IOS_DESTINATION="OS=11.1,name=iPhone 8" | ||
|
||
usage() { | ||
cat << EOF | ||
Usage: sh $0 command | ||
[Building] | ||
iOS Build iOS framework | ||
native Build using `swift build` | ||
clean Clean up all un-neccesary files | ||
[Testing] | ||
test-iOS Run tests on iOS host | ||
test-native Run tests using `swift test` | ||
EOF | ||
} | ||
|
||
COMMAND="$1" | ||
|
||
case "$COMMAND" in | ||
"clean") | ||
find . -type d -name build -exec rm -r "{}" +\; | ||
exit 0; | ||
;; | ||
|
||
"iOS" | "ios") | ||
xcodebuild clean \ | ||
-project $PROJECT \ | ||
-scheme "${SCHEME}" \ | ||
-sdk "${IOS_SDK}" \ | ||
-destination "${IOS_DESTINATION}" \ | ||
-configuration Debug ONLY_ACTIVE_ARCH=YES \ | ||
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO \ | ||
build | xcpretty -c | ||
exit 0; | ||
;; | ||
|
||
"native" | "") | ||
swift build | ||
exit 0; | ||
;; | ||
|
||
"test-iOS" | "test-ios") | ||
xcodebuild clean \ | ||
-project $PROJECT \ | ||
-scheme "${SCHEME}" \ | ||
-sdk "${IOS_SDK}" \ | ||
-destination "${IOS_DESTINATION}" \ | ||
-configuration Release \ | ||
ONLY_ACTIVE_ARCH=YES \ | ||
CODE_SIGNING_REQUIRED=NO \ | ||
ENABLE_TESTABILITY=YES \ | ||
build test | xcpretty -c | ||
exit 0; | ||
;; | ||
|
||
"test-native") | ||
swift package clean | ||
swift build | ||
swift test | ||
exit 0; | ||
;; | ||
esac | ||
|
||
usage |