#!/bin/bash -ex BUILD_DIR="$PWD/build" PROJECT="mas-cli.xcodeproj" SCHEME="mas-cli Release" CONFIG="Release" main() { script/clean carthage build \ --platform macOS \ --cache-builds \ --configuration "$CONFIG" build # If this is a tagged build we are going to release # TEMP: Generate archive on all builds # if [[ ! -z $TRAVIS_TAG ]]; then archive # fi } build() { echo "==> 🏗️ Building" set -o pipefail && \ xcodebuild -project "$PROJECT" \ -scheme "$SCHEME" \ -configuration "$CONFIG" \ OBJROOT="$BUILD_DIR/obj" \ SHARED_PRECOMPS_DIR="$OBJROOT/SharedPrecompiledHeaders" \ SYMROOT="$BUILD_DIR/sym" \ build \ | bundle exec xcpretty --color } archive() { echo "==> 📦 Archiving" set -o pipefail && \ xcodebuild -project "$PROJECT" \ -scheme "$SCHEME" \ -configuration "$CONFIG" \ -archivePath "$BUILD_DIR/mas.xcarchive" \ OBJROOT="$BUILD_DIR/obj" \ SHARED_PRECOMPS_DIR="$OBJROOT/SharedPrecompiledHeaders" \ SYMROOT="$BUILD_DIR/sym" \ archive \ | bundle exec xcpretty --color } main