56 lines
1.8 KiB
Bash
Executable File
56 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
dotnet_bin="${DOTNET_BIN:-${HOME}/.dotnet/dotnet}"
|
|
developer_dir="${DEVELOPER_DIR:-/Applications/Xcode.app/Contents/Developer}"
|
|
build_number="${1:-}"
|
|
codesign_key="${UM_TRACE_CODESIGN_KEY:-Apple Distribution}"
|
|
codesign_profile="${UM_TRACE_CODESIGN_PROVISION:-UM Trace App Store}"
|
|
|
|
if [[ ! "${build_number}" =~ ^[0-9]+$ ]]; then
|
|
echo "Usage: $0 <numeric-build-number>" >&2
|
|
exit 2
|
|
fi
|
|
|
|
if [[ ! -x "${dotnet_bin}" ]]; then
|
|
echo "Missing .NET 10 SDK at ${dotnet_bin}. Set DOTNET_BIN or install .NET 10." >&2
|
|
exit 2
|
|
fi
|
|
|
|
if [[ ! -d "${developer_dir}" ]]; then
|
|
echo "Missing Xcode developer directory at ${developer_dir}. Set DEVELOPER_DIR." >&2
|
|
exit 2
|
|
fi
|
|
|
|
export DEVELOPER_DIR="${developer_dir}"
|
|
|
|
"${dotnet_bin}" restore "${repo_dir}/FieldLogger/FieldLogger.csproj" \
|
|
-p:TargetFrameworks=net9.0-ios \
|
|
-p:RuntimeIdentifier=ios-arm64
|
|
|
|
# Restoring the MAUI head with a narrowed TargetFrameworks property can rewrite the
|
|
# referenced headless library's assets file. Restore that library explicitly before publish.
|
|
"${dotnet_bin}" restore "${repo_dir}/src/FieldLogger.Sync/FieldLogger.Sync.csproj"
|
|
|
|
"${dotnet_bin}" clean "${repo_dir}/FieldLogger/FieldLogger.csproj" \
|
|
-f net9.0-ios \
|
|
-c Release \
|
|
-p:TargetFrameworks=net9.0-ios \
|
|
-p:RuntimeIdentifier=ios-arm64
|
|
|
|
"${dotnet_bin}" publish "${repo_dir}/FieldLogger/FieldLogger.csproj" \
|
|
-p:TargetFrameworks=net9.0-ios \
|
|
-f net9.0-ios \
|
|
-c Release \
|
|
-p:RuntimeIdentifier=ios-arm64 \
|
|
-p:ArchiveOnBuild=true \
|
|
-p:BuildIpa=true \
|
|
-p:CodesignKey="${codesign_key}" \
|
|
-p:CodesignProvision="${codesign_profile}" \
|
|
-p:ApplicationVersion="${build_number}" \
|
|
--no-restore
|
|
|
|
find "${repo_dir}/FieldLogger/bin/Release/net9.0-ios/ios-arm64" \
|
|
-type f -name '*.ipa' -print
|