mas/script/build
2018-08-11 16:29:45 -06:00

52 lines
1.2 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
# TEMP: Generate archive on all builds
# 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