2019-01-03 23:30:33 +00:00
|
|
|
#!/bin/bash -e
|
2019-01-19 04:37:51 +00:00
|
|
|
#
|
|
|
|
# script/build
|
|
|
|
# mas
|
|
|
|
#
|
|
|
|
# Builds the Xcode project. Uses xcpretty gem to format output.
|
|
|
|
#
|
|
|
|
# If the TRAVIS_TAG env variable is present, it generates an archive.
|
|
|
|
# https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
|
|
|
#
|
2015-09-19 22:43:03 +00:00
|
|
|
|
2018-07-05 01:55:28 +00:00
|
|
|
BUILD_DIR="$PWD/build"
|
2020-06-05 18:21:30 +00:00
|
|
|
WORKSPACE="mas.xcworkspace"
|
2018-07-05 01:55:28 +00:00
|
|
|
SCHEME="mas-cli Release"
|
|
|
|
CONFIG="Release"
|
2019-01-13 07:58:51 +00:00
|
|
|
VERSION=$(script/version)
|
2018-07-05 01:55:28 +00:00
|
|
|
|
2015-09-20 10:14:32 +00:00
|
|
|
main() {
|
2020-05-25 03:18:05 +00:00
|
|
|
xcodebuild -version
|
2015-09-20 10:23:36 +00:00
|
|
|
script/clean
|
2018-10-14 22:05:31 +00:00
|
|
|
|
2018-10-15 03:49:23 +00:00
|
|
|
archive
|
2015-09-20 10:14:32 +00:00
|
|
|
}
|
|
|
|
|
2018-10-15 03:49:23 +00:00
|
|
|
# OBJROOT - Intermediate Build Files Path
|
|
|
|
# The path where intermediate files will be placed during a build. Intermediate files include generated sources, object
|
|
|
|
# files, etc. Shell script build phases can place and access files here, as well. Typically this path is not set per
|
|
|
|
# target, but is set per project or per user. By default, this is set to `$(PROJECT_DIR)/build`.
|
|
|
|
|
|
|
|
# SHARED_PRECOMPS_DIR - Precompiled Headers Cache Path
|
|
|
|
# The path where precompiled prefix header files are placed during a build. Defaults to `$(OBJROOT)/SharedPrecompiledHeaders`.
|
|
|
|
# Using a common location allows precompiled headers to be shared between multiple projects.
|
|
|
|
|
|
|
|
# SYMROOT - Build Procucts Path
|
|
|
|
# The path at which all products will be placed when performing a build. Typically this path is not set per target,
|
|
|
|
# but is set per-project or per-user. By default, this is set to `$(PROJECT_DIR)/build`.
|
|
|
|
|
2015-09-20 10:14:32 +00:00
|
|
|
build() {
|
2018-12-21 01:59:38 +00:00
|
|
|
echo "==> 🏗️ Building mas ($VERSION)"
|
2021-03-21 23:50:09 +00:00
|
|
|
set -o pipefail &&
|
|
|
|
xcodebuild \
|
|
|
|
-workspace "$WORKSPACE" \
|
|
|
|
-scheme "$SCHEME" \
|
|
|
|
-configuration "$CONFIG" \
|
|
|
|
OBJROOT="$BUILD_DIR" \
|
|
|
|
SYMROOT="$BUILD_DIR" \
|
|
|
|
build |
|
|
|
|
bundle exec xcpretty --color
|
2015-09-20 10:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
archive() {
|
2019-01-16 03:46:21 +00:00
|
|
|
echo "==> 📦 Archiving mas ($VERSION)"
|
2021-03-21 23:50:09 +00:00
|
|
|
set -o pipefail &&
|
|
|
|
xcodebuild \
|
|
|
|
-workspace "$WORKSPACE" \
|
|
|
|
-scheme "$SCHEME" \
|
|
|
|
-configuration "$CONFIG" \
|
|
|
|
-archivePath "$BUILD_DIR/mas.xcarchive" \
|
|
|
|
OBJROOT="$BUILD_DIR" \
|
|
|
|
SYMROOT="$BUILD_DIR" \
|
|
|
|
archive |
|
|
|
|
bundle exec xcpretty --color
|
2015-09-20 10:14:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
main
|