#!/bin/bash

export PATH=$PATH:/usr/local/bin
cd `git rev-parse --show-toplevel`

brew update > /dev/null || exit 1
brew update carthage || brew install carthage || exit 1
brew update xctool || brew install xctool || exit 1

xcodebuild -version | grep "Xcode 7" > /dev/null || { echo 'Not running Xcode 7' ; exit 1; }

carthage update --configuration Release --platform Mac
# Note we don't build iOS on device due to code signing requirements.
# xctool -project SwiftIO.xcodeproj -scheme "All" -sdk iphonesimulator build test || exit $!
xctool -project SwiftIO.xcodeproj -scheme "SwiftIO_OSX" -sdk macosx build test || exit $!

#!/bin/bash

export PATH=$PATH:/usr/local/bin

# Run from git project root.
cd `git rev-parse --show-toplevel`

# Check we're on current version of Xcode.
xcodebuild -version | grep "Xcode 7.2" > /dev/null || { echo 'Not running Xcode 7.2' ; exit 1; }

# Update brew, carthage and xctool.
brew update > /dev/null || exit 1
brew update carthage || brew install carthage || exit 1
brew update xctool || brew install xctool || exit 1

# Note we don't build iOS due to code signing requirements.

# Install dependencies
carthage bootstrap --configuration Release --platform Mac

xctool -project SwiftIO.xcodeproj -scheme "SwiftIO_OSX" -sdk macosx build test || exit $!
xctool -project SwiftIO.xcodeproj -scheme "TestApp" -sdk macosx build || exit $!

Build TestApp, use carthage bootstrap not update, comment script.
Build TestApp, use carthage bootstrap not update, comment script.
