Skip to content

Commit

Permalink
Update .travis.yml for Xcode 9 and add seperate build script
Browse files Browse the repository at this point in the history
Add swift build to the script
  • Loading branch information
JP Wright authored and loudmouth committed Feb 18, 2018
1 parent 80e2478 commit 713bad7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
language: objective-c # lol
language: objective-c
osx_image: xcode9.2
xcode_project: DVR.xcodeproj

script: xcodebuild -scheme "$TRAVIS_XCODE_SCHEME" -sdk "$TRAVIS_XCODE_SDK" -destination "$DESTINATION" test

matrix:
include:
- xcode_scheme: DVR-iOS
xcode_sdk: iphonesimulator
env:
- DESTINATION="OS=10.1,name=iPhone 7 Plus"
- PLATFORM="iOS Simulator,OS=11.2,name=iPhone 7 Plus"
- xcode_scheme: DVR-macOS
xcode_sdk: macosx
env:
- DESTINATION="arch=x86_64"
- PLATFORM="OS X"
- env:
- SWIFT_BUILD=true

script:
- ./Scripts/travis-build-test.sh

14 changes: 14 additions & 0 deletions Scripts/travis-build-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

set -x -o pipefail

if [[ "$SWIFT_BUILD" == "true" ]]; then
swift build
exit 0
fi

# -jobs -- specify the number of concurrent jobs
# `sysctl -n hw.ncpu` -- fetch number of 'logical' cores in macOS machine
xcodebuild -jobs `sysctl -n hw.ncpu` test -project DVR.xcodeproj -scheme ${TRAVIS_XCODE_SCHEME} -sdk ${TRAVIS_XCODE_SDK} \
-destination "platform=${PLATFORM}" ONLY_ACTIVE_ARCH=YES CODE_SIGNING_IDENTITY="" CODE_SIGNING_REQUIRED=NO

0 comments on commit 713bad7

Please sign in to comment.