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