mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
8306c6eb2c
Obtain version & revision from most recent version tag in the current branch, not from environment variable or argument. Do not branch or commit on release. Partial #638 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
40 lines
778 B
Bash
Executable file
40 lines
778 B
Bash
Executable file
#!/bin/bash -eu
|
|
#
|
|
# script/build
|
|
# mas
|
|
#
|
|
# Builds the Swift Package.
|
|
#
|
|
|
|
mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")"
|
|
|
|
if ! cd -- "${mas_dir}"; then
|
|
printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Build for the host architecture by default.
|
|
if [[ "${#}" -ge 1 && "${1}" == '--universal' ]]; then
|
|
ARCH=(
|
|
--arch arm64
|
|
--arch x86_64
|
|
)
|
|
else
|
|
ARCH=()
|
|
fi
|
|
|
|
# Disable the manifest cache.
|
|
if [[ "$(swift build --help)" =~ manifest-cache ]]; then
|
|
CACHE=(--manifest-cache none)
|
|
else
|
|
CACHE=()
|
|
fi
|
|
|
|
script/generate_version_info_for_swift
|
|
|
|
echo "==> 🏗️ Building mas $(script/version)"
|
|
swift build \
|
|
--configuration release \
|
|
"${ARCH[@]+"${ARCH[@]}"}" \
|
|
--disable-sandbox \
|
|
"${CACHE[@]+"${CACHE[@]}"}"
|