mas/script/build

58 lines
1.7 KiB
Text
Raw Normal View History

2018-10-14 22:05:31 +00:00
#!/bin/bash -ex
2015-09-19 22:43:03 +00:00
BUILD_DIR="$PWD/build"
2018-09-04 23:44:50 +00:00
PROJECT="mas-cli.xcodeproj"
SCHEME="mas-cli Release"
CONFIG="Release"
main() {
2015-09-20 10:23:36 +00:00
script/clean
2018-10-14 22:05:31 +00:00
2018-09-04 23:45:01 +00:00
carthage build \
--platform macOS \
--cache-builds \
--configuration "$CONFIG"
archive
}
# 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`.
build() {
echo "==> 🏗️ Building"
2017-05-23 17:05:57 +00:00
set -o pipefail && \
2018-09-04 23:44:50 +00:00
xcodebuild -project "$PROJECT" \
-scheme "$SCHEME" \
-configuration "$CONFIG" \
OBJROOT="$BUILD_DIR" \
SYMROOT="$BUILD_DIR" \
build \
2018-01-27 02:51:01 +00:00
| bundle exec xcpretty --color
}
archive() {
echo "==> 📦 Archiving"
2017-05-23 17:05:57 +00:00
set -o pipefail && \
2018-09-04 23:44:50 +00:00
xcodebuild -project "$PROJECT" \
-scheme "$SCHEME" \
-configuration "$CONFIG" \
-archivePath "$BUILD_DIR/mas.xcarchive" \
OBJROOT="$BUILD_DIR" \
SYMROOT="$BUILD_DIR" \
2017-05-23 17:05:57 +00:00
archive \
2018-01-27 02:51:01 +00:00
| bundle exec xcpretty --color
}
main