diff --git a/.travis.sh b/.travis.sh new file mode 100755 index 0000000..9793771 --- /dev/null +++ b/.travis.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +set -eu + +if [[ "$#" -ne 2 ]]; then + echo "Usage: $0 {iOS|OSX} {Debug|Release}" + exit 10 +fi + +BUILD_MODE="$1" +BUILD_CFG="$2" + +CMD_BUILDER=( + xcodebuild +) + +case "${BUILD_MODE}" in + iOS) + CMD_BUILDER+=( + -workspace Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace + -scheme OAuthSampleTouch + -sdk iphonesimulator + # No -destination since there are no tests. + ) + ;; + OSX) + CMD_BUILDER+=( + -workspace Examples/OAuth2Sample/OAuth2Sample.xcworkspace + -scheme OAuth2Sample + # No -destination since there are no tests. + ) + ;; + *) + echo "Unknown BUILD_MODE: ${BUILD_MODE}" + exit 11 + ;; +esac + +case "${BUILD_CFG}" in + Debug|Release) + CMD_BUILDER+=(-configuration "${BUILD_CFG}") + ;; + *) + echo "Unknown BUILD_CFG: ${BUILD_CFG}" + exit 12 + ;; +esac + +CMD_BUILDER+=( + build +) + +set -x +exec "${CMD_BUILDER[@]}" diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b38159e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: objective-c +osx_image: xcode7.3 +env: + - MODE=OSX CFG=Debug + - MODE=OSX CFG=Release + - MODE=iOS CFG=Debug + - MODE=iOS CFG=Release +script: + - ./.travis.sh "${MODE}" "${CFG}" +notifications: + email: false