#!/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" # This dependency-free package has no plugins. Disable nested SwiftPM sandboxing # for agent environments; Swift Testing does not need the XCTest bundle runner. swift test --package-path Packages/WristivoKit --scratch-path "$scratch/swiftpm" \ --cache-path "$scratch/cache" --config-path "$scratch/config" \ --security-path "$scratch/security" --disable-sandbox --disable-xctest 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