mas/script/build
2018-07-04 19:55:28 -06:00

51 lines
1.1 KiB
Bash
Executable file

#!/bin/bash -e
BUILD_DIR="$PWD/build"
WORKSPACE="mas-cli.xcworkspace"
SCHEME="mas-cli Release"
CONFIG="Release"
main() {
script/clean
xcodebuild -workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-configuration "$CONFIG" \
clean
build
# If this is a tagged build we are going to release
if [[ ! -z $TRAVIS_TAG ]]; then
archive
fi
}
build() {
echo "==> 🏗️ Building"
set -o pipefail && \
xcodebuild -workspace "$WORKSPACE" \
-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 -workspace "$WORKSPACE" \
-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