Files
wristivo/Scripts/check.sh

33 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/.."
scratch=$(mktemp -d "${TMPDIR:-/private/tmp}/wristivo-check.XXXXXX")
trap 'rm -rf "$scratch"' EXIT
export CLANG_MODULE_CACHE_PATH="$scratch/clang-cache"
export SWIFTPM_MODULECACHE_OVERRIDE="$scratch/module-cache"
# These local packages have no third-party dependencies or plugins. Disable nested SwiftPM sandboxing
# for agent environments. All adapter tests must execute, not merely compile.
for package in Packages/WristivoKit Adapters/WatchBridge Adapters/TVTransport Adapters/SecureStorage Adapters/PhoneControl; do
swift test --package-path "$package" --scratch-path "$scratch/$(basename "$package")" \
--cache-path "$scratch/cache" --config-path "$scratch/config" \
--security-path "$scratch/security" --disable-sandbox
done
plutil -lint Resources/PrivacyInfo.xcprivacy
if [ "${1:-}" = "--apps" ]; then
extra_args=()
if [ "${WRISTIVO_AGENT_BUILD:-0}" = "1" ]; then
# Only for a sandboxed developer host that cannot start a nested manifest
# sandbox; this package is local, dependency-free and has no build plugins.
extra_args+=(-IDEPackageSupportDisableManifestSandbox=YES)
extra_args+=('OTHER_SWIFT_FLAGS=$(inherited) -disable-sandbox')
fi
xcodebuild -project Wristivo.xcodeproj -scheme WristivoWatch \
${extra_args[@]+"${extra_args[@]}"} \
-configuration Debug -destination 'generic/platform=watchOS' \
-derivedDataPath "$scratch/DerivedDataWatch" -packageCachePath "$scratch/xcode-packages" CODE_SIGNING_ALLOWED=NO build
xcodebuild -project Wristivo.xcodeproj -scheme Wristivo \
${extra_args[@]+"${extra_args[@]}"} \
-configuration Debug -destination 'generic/platform=iOS' \
-derivedDataPath "$scratch/DerivedDataPhone" -packageCachePath "$scratch/xcode-packages" CODE_SIGNING_ALLOWED=NO build
fi