mas/script/build

27 lines
507 B
Text
Raw Normal View History

2019-01-03 23:30:33 +00:00
#!/bin/bash -e
#
# script/build
# mas
#
2021-04-28 21:49:54 +00:00
# Builds the Swift Package.
#
2021-05-07 18:33:39 +00:00
# Build for the host architecture by default.
2021-06-09 01:56:27 +00:00
ARCH=()
2021-05-07 18:33:39 +00:00
if [[ "$1" == '--universal' ]]; then
2021-06-09 01:56:27 +00:00
ARCH=(--arch arm64 --arch x86_64)
2021-05-07 18:33:39 +00:00
fi
# Disable the manifest cache on Xcode 12.5 and later.
2021-06-09 01:56:27 +00:00
CACHE=()
2021-05-07 18:33:39 +00:00
if [[ "$(swift build --help)" =~ manifest-cache ]]; then
2021-06-09 01:56:27 +00:00
CACHE=(--manifest-cache none)
2021-05-07 18:33:39 +00:00
fi
2021-04-28 21:49:54 +00:00
echo "==> 🏗️ Building mas ($(script/version))"
swift build \
--configuration release \
2021-06-09 01:56:27 +00:00
"${ARCH[@]}" \
--disable-sandbox \
2021-06-09 01:56:27 +00:00
"${CACHE[@]}"