#!/bin/bash set -euo pipefail cd "$(dirname "$0")/../.." unset BASH_ENV if [[ -z ${PARCEL_DEV_BINARY:-} ]]; then PARCEL_DEV_BINARY=$(Scripts/parcel-dev.sh --path) fi PARCEL_DEV_BINARY=$(realpath "$PARCEL_DEV_BINARY") export PARCEL_DEV_BINARY work=$(mktemp -d "$PWD/.build/packaging fixture.XXXXXX") trap 'rm -rf "$work"' EXIT trap 'printf "Packaging fixture failed at line %s: %s\n" "$LINENO" "$BASH_COMMAND" >&2' ERR mkdir -p "$work/project/Scripts" "$work/project/Resources" "$work/project/Sources" "$work/bin" "$work/products" "$work/probe/Sources/Probe/Resources/Probe.xcassets/Sample.imageset" cp Scripts/swift-build.sh Scripts/product.env Scripts/version.sh Scripts/packaging-paths.sh Scripts/bundle-preflight.sh Scripts/check-app-icons.sh Scripts/parcel-dev.sh Scripts/check-localization-pseudo.sh Scripts/bundle.sh Scripts/check-reality-isolation.sh Scripts/check-bundle.sh Scripts/designated-requirement.sh Scripts/make-dev-cert.sh Scripts/test.sh Scripts/test-e2e.sh Scripts/screen-lock.sh Scripts/check-e2e-results.swift Scripts/test-remote.sh Scripts/remote-sync.sh "$work/project/Scripts/" cp Resources/Info.plist "$work/project/Resources/" printf "export PRODUCT_SUPPORT_EMAIL='support@example.org'\nexport PRODUCT_ISSUES_URL='https://example.org/parcel/issues'\n" >> "$work/project/Scripts/product.env" mkdir "$work/project/Packaging" cp Packaging/Sparkle-LICENSE "$work/project/Packaging/" mkdir -p "$work/project/Packaging/AlternateIcons" "$work/project/Sources/ParcelUI/Resources" "$work/probe/Sources/Probe/Resources/AppIcons" cp Packaging/AlternateIcons/IconTool.swift "$work/project/Packaging/AlternateIcons/" ditto Sources/ParcelUI/Resources/AppIcons "$work/project/Sources/ParcelUI/Resources/AppIcons" ditto Sources/ParcelUI/Resources/AppIcons "$work/probe/Sources/Probe/Resources/AppIcons" ditto Resources/Assets.xcassets "$work/project/Resources/Assets.xcassets" mkdir -p "$work/probe/Plugins/CompileStrings" "$work/probe/Scripts" cp Plugins/CompileStrings/Plugin.swift "$work/probe/Plugins/CompileStrings/" cp Scripts/generate-config-strings.sh Scripts/parcel-dev.sh "$work/probe/Scripts/" cp -R Sources/ParcelDev Sources/parcel-dev "$work/probe/Sources/" printf '%s\n' '// swift-tools-version: 6.2' 'import Foundation' 'import PackageDescription' \ 'let excluded = ProcessInfo.processInfo.environment["PARCEL_BUNDLE_BUILD"] == "1" ? ["Resources/Localizable.xcstrings"] : []' \ 'let package = Package(name: "Probe", defaultLocalization: "en", platforms: [.macOS(.v15)], targets: [.executableTarget(name: "Probe", exclude: excluded, resources: [.process("Resources")], plugins: ["CompileStrings"]), .target(name: "ParcelDev"), .executableTarget(name: "parcel-dev", dependencies: ["ParcelDev"]), .plugin(name: "CompileStrings", capability: .buildTool(), dependencies: ["parcel-dev"])])' > "$work/probe/Package.swift" printf '%s\n' 'import Foundation' 'let arguments = CommandLine.arguments.dropFirst()' \ 'if arguments.contains("--pseudo") { UserDefaults.standard.setVolatileDomain(["AppleLanguages": ["en-XA"]], forName: UserDefaults.argumentDomain) }' \ 'if arguments.contains("--pseudo") {' \ ' precondition(String(localized: "greeting", bundle: .module) == "⟦Ĥéľľó⟧")' \ ' precondition(String(localized: "Hello", bundle: .main) == "⟦Ĥéľľó⟧")' \ '}' \ 'else if arguments.contains("--version") { print("0.1.0") }' \ 'else if arguments.contains("--smoke") {' \ ' for name in ["classic", "night", "sunrise", "patchwork", "sprout", "orbit", "confetti", "blueprint"] {' \ ' for mode in ["light", "dark", "tinted"] { precondition(Bundle.module.url(forResource: "AppIcon-\(name)-\(mode)", withExtension: "png") != nil) }' \ ' }' \ ' precondition(String(localized: "greeting", bundle: .module) == "Hello")' \ ' precondition(Bundle.module.localizedString(forKey: "Source key", value: "Missing", table: nil) == "Source key")' \ ' guard let url = Bundle.module.url(forResource: "fr", withExtension: "lproj"), let french = Bundle(url: url) else { fatalError("Missing French resources") }' \ ' precondition(french.localizedString(forKey: "greeting", value: "Missing", table: nil) == "Bonjour")' \ '}' \ 'else if arguments.contains("--french") { precondition(String(localized: "greeting", bundle: .module) == "Bonjour") }' \ 'else if arguments.contains("--help") { print(String(localized: "greeting", bundle: .module)) }' \ 'else { print(Bundle.module.bundleURL.path) }' > "$work/probe/Sources/Probe/main.swift" printf '%s\n' '{"sourceLanguage":"en","strings":{"greeting":{"localizations":{"en":{"stringUnit":{"state":"translated","value":"Initial"}}}}},"version":"1.0"}' > "$work/probe/Sources/Probe/Resources/Localizable.xcstrings" printf '%s\n' '{"info":{"author":"xcode","version":1}}' > "$work/probe/Sources/Probe/Resources/Probe.xcassets/Contents.json" printf '%s\n' '{"images":[{"filename":"sample.png","idiom":"universal"}],"info":{"author":"xcode","version":1}}' > "$work/probe/Sources/Probe/Resources/Probe.xcassets/Sample.imageset/Contents.json" sips -s format png /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns --out "$work/probe/Sources/Probe/Resources/Probe.xcassets/Sample.imageset/sample.png" > /dev/null test "$(swift run --quiet --package-path "$work/probe" Probe --help)" = Initial PARCEL_BUNDLE_BUILD=1 swift build --quiet --build-system swiftbuild --package-path "$work/probe" --scratch-path "$work/native" printf '%s\n' '{"sourceLanguage":"en","strings":{"Source key":{},"greeting":{"localizations":{"en":{"stringUnit":{"state":"translated","value":"Hello"}},"fr":{"stringUnit":{"state":"translated","value":"Bonjour"}}}}},"version":"1.0"}' > "$work/probe/Sources/Probe/Resources/Localizable.xcstrings" swift run --quiet --package-path "$work/probe" Probe --smoke PARCEL_BUNDLE_BUILD=1 swift build --quiet --build-system swiftbuild --package-path "$work/probe" --scratch-path "$work/native" probe_bin=$(PARCEL_BUNDLE_BUILD=1 swift build --build-system swiftbuild --package-path "$work/probe" --scratch-path "$work/native" --show-bin-path) cp "$probe_bin/Probe" "$work/products/ParcelApp" cp "$probe_bin/Probe" "$work/products/prcl" ditto "$probe_bin/Probe_Probe.bundle" "$work/products/Probe_Probe.bundle" ditto "$probe_bin/Probe_Probe.bundle" "$work/products/Parcel_ParcelUI.bundle" mkdir -p "$work/project/Sources/Probe/Resources" cp "$work/probe/Sources/Probe/Resources/Localizable.xcstrings" "$work/project/Sources/Probe/Resources/" rm -rf "$work/probe" # Builds are mocked below; keep the fixture independent of toolchain probing. printf '#!/bin/sh\nset -eu\nexec swift build "$@"\n' > "$work/project/Scripts/swift-build.sh" export TEST_BIN_DIR="$work/products" TEST_SWIFT_LOG="$work/swift.log" TEST_LIPO_LOG="$work/lipo.log" export TEST_SSH_LOG="$work/ssh.log" TEST_RSYNC_LOG="$work/rsync.log" export TEST_CODESIGN_LOG="$work/codesign.log" TEST_SECURITY_LOG="$work/security.log" export PARCEL_SCREEN_LOCK_PATH="$work/screen.lock" export PARCEL_SIGN_IDENTITY=- export PARCEL_SPARKLE_FRAMEWORK="$PWD/.build/artifacts/sparkle/Sparkle/Sparkle.xcframework/macos-arm64_x86_64/Sparkle.framework" export PARCEL_APPCAST_URL=https://example.org/appcast.xml export PARCEL_UPDATE_PUBLIC_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= unset PARCEL_BUNDLE_ID PARCEL_VERSION PARCEL_BUILD_NUMBER cat > "$work/bin/swift" <<'MOCK' #!/bin/bash set -euo pipefail printf '%s E2E=%s BUNDLE=%s\n' "$*" "${PARCEL_E2E:-}" "${PARCEL_BUNDLE_BUILD:-}" >> "$TEST_SWIFT_LOG" if [[ ${TEST_FAIL_TEST:-0} == 1 && ${1:-} == test ]]; then exit 1 fi if [[ " $* " == *' --show-bin-path '* ]]; then printf '%s\n' "$TEST_BIN_DIR" elif [[ ${1:-} == test ]]; then while (( $# )); do if [[ $1 == --xunit-output ]]; then printf '%s\n' '' \ '' \ '' \ '' > "${2%.xml}-swift-testing.xml" break fi shift done fi MOCK cat > "$work/bin/caffeinate" <<'MOCK' #!/bin/bash set -euo pipefail [[ $1 == -dimsu ]] shift exec "$@" MOCK cat > "$work/bin/lipo" <<'MOCK' #!/bin/bash set -euo pipefail printf '%s\n' "$*" >> "$TEST_LIPO_LOG" [[ $# -eq 4 && $2 == -verify_arch && $3 == arm64 && $4 == x86_64 ]] MOCK cat > "$work/bin/git" <<'MOCK' #!/bin/bash set -euo pipefail [[ $* == 'ls-files -z' ]] printf '%s\0' Scripts/test.sh Resources/Info.plist Resources/deleted.txt [[ ${TEST_FAIL_GIT:-0} != 1 ]] MOCK cat > "$work/bin/ssh" <<'MOCK' #!/bin/bash set -euo pipefail printf '%s\n' "$*" >> "$TEST_SSH_LOG" if [[ $* == *mktemp* ]]; then printf 'run.abc12345\n' fi MOCK cat > "$work/bin/rsync" <<'MOCK' #!/bin/bash set -euo pipefail for arg in "$@"; do if [[ $arg == --files-from=* ]]; then tr '\0' '\n' < "${arg#--files-from=}" > "$TEST_RSYNC_LOG" printf '%s\n' "$*" >> "$TEST_RSYNC_LOG" exit 0 fi done exec /usr/bin/rsync "$@" MOCK cat > "$work/bin/security" <<'MOCK' #!/bin/bash set -euo pipefail printf '%s\n' "$*" >> "$TEST_SECURITY_LOG" if [[ ${TEST_FAIL_SECURITY:-0} == 1 ]]; then exit 1 fi printf '%s\n' "${TEST_IDENTITIES:- 0 valid identities found}" MOCK cat > "$work/bin/codesign" <<'MOCK' #!/bin/bash set -euo pipefail printf '%s\n' "$*" >> "$TEST_CODESIGN_LOG" if [[ ${1:-} == -dv && ${TEST_FAIL_FRAMEWORK_METADATA:-0} == 1 ]]; then printf 'Could not inspect framework signature\n' >&2 exit 1 fi if [[ ${1:-} == -dv && ${TEST_MISSING_FRAMEWORK_TEAM:-0} == 1 ]]; then printf 'Signature=adhoc\n' >&2 exit 0 fi if [[ ${1:-} == -dv && -n ${TEST_TEAM_IDENTIFIER:-} ]]; then printf 'TeamIdentifier=%s\n' "$TEST_TEAM_IDENTIFIER" >&2 exit 0 fi args=() while (( $# )); do if [[ $1 == --sign ]]; then args+=(--sign -) shift 2 elif [[ $1 == --timestamp ]]; then if [[ ${TEST_TIMESTAMP_UNAVAILABLE:-0} == 1 ]]; then printf 'Timestamp service unavailable\n' >&2 exit 1 fi shift else args+=("$1") shift fi done exec /usr/bin/codesign "${args[@]}" MOCK chmod +x "$work/bin/swift" "$work/bin/caffeinate" "$work/bin/lipo" "$work/bin/git" "$work/bin/ssh" "$work/bin/rsync" "$work/bin/security" "$work/bin/codesign" export PATH="$work/bin:$PATH" cd "$work/project" count=0 check() { if ! "$@"; then echo "Packaging test failed: $*" >&2 exit 1 fi count=$((count + 1)) } fails() { if "$@" > "$work/failure.log" 2>&1; then echo "Expected failure: $*" >&2 /bin/cat "$work/failure.log" >&2 return 1 fi } app_entitlements() { codesign -d --entitlements - --xml "$app" > "$work/app-entitlements.plist" 2> "$work/app-entitlements.log" } library_validation_disabled() { app_entitlements /usr/libexec/PlistBuddy -c 'Print :com.apple.security.cs.disable-library-validation' "$work/app-entitlements.plist" } check fails Scripts/bundle.sh invalid check fails Scripts/bundle.sh release check grep -q 'PARCEL_ALLOW_ADHOC=1' "$work/failure.log" export PARCEL_ALLOW_ADHOC=1 check fails env PARCEL_APPCAST_URL=http://example.org/feed Scripts/bundle.sh release check fails env PARCEL_UPDATE_PUBLIC_KEY=bad Scripts/bundle.sh release check fails env PARCEL_SPARKLE_FRAMEWORK=/missing Scripts/bundle.sh check fails env PARCEL_BUNDLE_ID=bad Scripts/bundle.sh check fails env PARCEL_VERSION='1;bad' Scripts/bundle.sh check fails Scripts/designated-requirement.sh check fails Scripts/designated-requirement.sh missing.app check fails Scripts/test-remote.sh check fails Scripts/test-remote.sh -bad check fails env TEST_FAIL_GIT=1 Scripts/test-remote.sh test-host check test ! -e "$TEST_SSH_LOG" check test ! -e "$TEST_RSYNC_LOG" printf 'private\n' > Resources/secret.env check Scripts/test-remote.sh test-host check grep -q '^Resources/Info.plist$' "$TEST_RSYNC_LOG" check grep -q '^Scripts/test.sh$' "$TEST_RSYNC_LOG" check fails grep -q 'secret.env\|deleted.txt' "$TEST_RSYNC_LOG" check grep -q 'test-host:parcel-ci/run.abc12345/' "$TEST_RSYNC_LOG" check grep -q 'cd ~/parcel-ci/run.abc12345 && Scripts/test.sh' "$TEST_SSH_LOG" printf '%s\0' Resources/Info.plist Scripts/test.sh > "$work/files.list" mkdir "$work/rsync-copy" check /usr/bin/rsync -az --from0 --files-from="$work/files.list" ./ "$work/rsync-copy/" check test -f "$work/rsync-copy/Resources/Info.plist" check test -f "$work/rsync-copy/Scripts/test.sh" check test ! -e "$work/rsync-copy/Resources/secret.env" rm Resources/secret.env check fails Scripts/make-dev-cert.sh Resources/Art.xcassets/Contents.json printf '%s\n' '{"images":[{"filename":"sample.png","idiom":"universal"}],"info":{"author":"xcode","version":1}}' > Resources/Art.xcassets/Sample.imageset/Contents.json sips -s format png /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns --out Resources/Art.xcassets/Sample.imageset/sample.png > /dev/null printf '%s\n' '{"sourceLanguage":"en","strings":{"Hello":{"localizations":{"en":{"stringUnit":{"state":"translated","value":"Hello"}}}}},"version":"1.0"}' > Resources/Localizable.xcstrings printf 'resource\n' > Resources/deep/sample.txt if ! PARCEL_BUNDLE_ID=org.example.parcel PARCEL_VERSION=2.3.4 PARCEL_BUILD_NUMBER=42 Scripts/bundle.sh debug 2> "$work/bundle.log"; then /bin/cat "$work/bundle.log" >&2 exit 1 fi app=build/Parcel.app if [[ ! -x $app/Contents/MacOS/Parcel ]]; then find build -print >&2 /bin/cat "$work/bundle.log" >&2 fi plist=$app/Contents/Info.plist check test -x "$app/Contents/MacOS/Parcel" check Scripts/check-bundle.sh --no-launch "$app" check Scripts/check-bundle.sh "$app" check test "$(library_validation_disabled)" = true check app_entitlements check fails /usr/libexec/PlistBuddy -c 'Print :com.apple.security.get-task-allow' "$work/app-entitlements.plist" check test -L "$app/Contents/Frameworks/Sparkle.framework/Sparkle" check test "$(/usr/libexec/PlistBuddy -c 'Print :ParcelUpdatesEnabled' "$plist")" = false check test "$(/usr/libexec/PlistBuddy -c 'Print :SUEnableAutomaticChecks' "$plist")" = false check fails /usr/libexec/PlistBuddy -c 'Print :SUPublicEDKey' "$plist" check test -x "$app/Contents/Resources/bin/prcl" check test -f "$app/Contents/Resources/bin/Info.plist" check test ! -L "$app/Contents/Resources/bin/Info.plist" check cmp "$app/Contents/Info.plist" "$app/Contents/Resources/bin/Info.plist" check "$app/Contents/Resources/bin/prcl" --french -AppleLanguages '(fr)' check test -d "$app/Contents/Resources/Probe_Probe.bundle" check test -f "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/Assets.car" check test -f "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/en.lproj/Localizable.strings" check test -f "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/fr.lproj/Localizable.strings" check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleDevelopmentRegion' "$plist")" = en check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleLocalizations:0' "$plist")" = en check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleLocalizations:1' "$plist")" = fr check fails /usr/libexec/PlistBuddy -c 'Print :CFBundleLocalizations:2' "$plist" check "$app/Contents/MacOS/Parcel" --french -AppleLanguages '(fr)' check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleAllowMixedLocalizations' "$plist")" = true check test -f "$app/Contents/Resources/en-XA.lproj/Localizable.strings" check test -f "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/en-XA.lproj/Localizable.strings" check "$app/Contents/MacOS/Parcel" --pseudo -AppleLanguages '(fr)' check test -L "$app/Contents/Resources/bin/Probe_Probe.bundle" check test -d "$("$app/Contents/MacOS/Parcel")" check test -d "$("$app/Contents/Resources/bin/prcl")" check codesign --verify --strict --deep "$app" check test -f "$app/Contents/Resources/deep/sample.txt" check test -f "$app/Contents/Resources/Assets.car" check test -f "$app/Contents/Resources/en.lproj/Localizable.strings" check test -f "$app/Contents/Resources/AppIcon.icns" check Scripts/check-app-icons.sh "$app" check test -f "$app/Contents/Resources/Parcel_ParcelUI.bundle/Contents/Resources/AppIcon-blueprint-tinted.png" check test ! -e "$app/Contents/Resources/Parcel_ParcelUI.bundle/Contents/Resources/AppIcons" check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIconFile' "$plist")" = AppIcon check test "$(/usr/libexec/PlistBuddy -c 'Print :LSMinimumSystemVersion' "$plist")" = 15.0 check test "$(/usr/libexec/PlistBuddy -c 'Print :greeting' "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/en.lproj/Localizable.strings")" = Hello check test "$("$app/Contents/Resources/bin/prcl" --help)" = Hello check "$app/Contents/Resources/bin/prcl" --smoke check test ! -e "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/Localizable.xcstrings" check test ! -e "$app/Contents/Resources/Localizable.xcstrings" check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$plist")" = org.example.parcel check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleShortVersionString' "$plist")" = 2.3.4 check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleVersion' "$plist")" = 42 source Scripts/product.env check test "$(/usr/libexec/PlistBuddy -c 'Print :ParcelSupportEmail' "$plist")" = "$PRODUCT_SUPPORT_EMAIL" check test "$(/usr/libexec/PlistBuddy -c 'Print :ParcelIssuesURL' "$plist")" = "$PRODUCT_ISSUES_URL" check test "$(/usr/libexec/PlistBuddy -c 'Print :LSUIElement' "$plist")" = true check codesign --verify --strict "$app" check codesign --verify --strict "$app/Contents/Resources/bin/prcl" check grep -q 'Ad-hoc builds' "$work/bundle.log" check Scripts/designated-requirement.sh "$app" "$app" > "$work/requirements.log" check Scripts/designated-requirement.sh "$app/Contents/MacOS/Parcel" "$app/Contents/MacOS/Parcel" > "$work/executable-requirements.log" check grep -q 'Previous:' "$work/requirements.log" check Scripts/designated-requirement.sh --print "$app" > "$work/print-requirement.log" check test -s "$work/print-requirement.log" check fails grep -q '^Previous:' "$work/print-requirement.log" ditto "$app" "$work/damaged.app" /usr/libexec/PlistBuddy -c 'Set :CFBundleVersion 99' "$work/damaged.app/Contents/Info.plist" check fails Scripts/designated-requirement.sh "$work/damaged.app" "$work/damaged.app" check fails Scripts/designated-requirement.sh "$app" "$work/damaged.app" ditto "$app" "$work/previous.app" /usr/libexec/PlistBuddy -c 'Set :CFBundleVersion 43' "$work/previous.app/Contents/Info.plist" codesign --force --sign - --options runtime "$work/previous.app" > /dev/null 2>&1 check fails Scripts/designated-requirement.sh "$work/previous.app" "$app" check grep -q 'Designated requirement changed' "$work/failure.log" mkdir Resources/duplicate cp Resources/Localizable.xcstrings Resources/duplicate/Localizable.xcstrings check fails Scripts/bundle.sh check grep -q 'Resource already exists' "$work/failure.log" check codesign --verify --strict "$app" rm Resources/duplicate/Localizable.xcstrings mkdir Resources/Probe_Probe.bundle check fails Scripts/bundle.sh check grep -q 'Resource bundle already exists' "$work/failure.log" check codesign --verify --strict "$app" rmdir Resources/Probe_Probe.bundle check Scripts/bundle.sh debug --inspectable > "$work/inspectable.log" 2>&1 check app_entitlements check test "$(/usr/libexec/PlistBuddy -c 'Print :com.apple.security.get-task-allow' "$work/app-entitlements.plist")" = true check test "$(library_validation_disabled)" = true check fails Scripts/bundle.sh release --inspectable check fails Scripts/bundle.sh release --reality check fails Scripts/bundle.sh debug --preview check env -u PARCEL_ALLOW_ADHOC PARCEL_SIGN_IDENTITY=Fixture TEST_TIMESTAMP_UNAVAILABLE=1 Scripts/bundle.sh release --preview > "$work/preview.log" 2>&1 check test "$(/usr/libexec/PlistBuddy -c 'Print :ParcelUpdatesEnabled' "$plist")" = false check test "$(/usr/libexec/PlistBuddy -c 'Print :SUEnableAutomaticChecks' "$plist")" = false check fails /usr/libexec/PlistBuddy -c 'Print :SUFeedURL' "$plist" check fails /usr/libexec/PlistBuddy -c 'Print :SUPublicEDKey' "$plist" check fails /usr/libexec/PlistBuddy -c 'Print :CFBundleAllowMixedLocalizations' "$plist" check app_entitlements check fails /usr/libexec/PlistBuddy -c 'Print :com.apple.security.get-task-allow' "$work/app-entitlements.plist" check Scripts/check-bundle.sh --no-launch "$app" check Scripts/bundle.sh release > "$work/release.log" 2>&1 check test ! -e "$app/Contents/Resources/en-XA.lproj" check test ! -e "$app/Contents/Resources/Probe_Probe.bundle/Contents/Resources/en-XA.lproj" check fails /usr/libexec/PlistBuddy -c 'Print :CFBundleAllowMixedLocalizations' "$plist" mkdir "$work/products/Probe_Probe.bundle/Contents/Resources/en-XA.lproj" check fails Scripts/bundle.sh release check grep -q 'Release bundle contains pseudo-localization resources' "$work/failure.log" check codesign --verify --strict "$app" rmdir "$work/products/Probe_Probe.bundle/Contents/Resources/en-XA.lproj" check app_entitlements check fails /usr/libexec/PlistBuddy -c 'Print :com.apple.security.get-task-allow' "$work/app-entitlements.plist" check test "$(/usr/libexec/PlistBuddy -c 'Print :SUFeedURL' "$plist")" = "$PARCEL_APPCAST_URL" check test "$(/usr/libexec/PlistBuddy -c 'Print :SUPublicEDKey' "$plist")" = "$PARCEL_UPDATE_PUBLIC_KEY" check Scripts/check-bundle.sh --no-launch "$app" check grep -q -- '--preserve-metadata=entitlements.*Downloader.xpc' "$TEST_CODESIGN_LOG" check grep -q 'build --scratch-path .*\.build/bundle/normal --build-system swiftbuild -c release .*--product ParcelApp E2E= BUNDLE=1' "$TEST_SWIFT_LOG" check fails grep -Fq 'ConciseMagicFile' "$TEST_SWIFT_LOG" check fails grep -q -- '--arch' "$TEST_SWIFT_LOG" check grep -q 'ParcelApp -verify_arch arm64 x86_64' "$TEST_LIPO_LOG" check grep -q 'prcl -verify_arch arm64 x86_64' "$TEST_LIPO_LOG" check test "$(/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' "$plist")" = dev.vinnymac.parcel check env -u PARCEL_SIGN_IDENTITY Scripts/bundle.sh > "$work/default-sign.log" 2>&1 check grep -q 'Ad-hoc builds lose' "$work/default-sign.log" check grep -Fq "$HOME/Library/Keychains/login.keychain-db" "$TEST_SECURITY_LOG" fingerprint=0123456789ABCDEF0123456789ABCDEF01234567 identities=" 1) $fingerprint \"Parcel Development\"" check env -u PARCEL_SIGN_IDENTITY TEST_IDENTITIES="$identities" TEST_TIMESTAMP_UNAVAILABLE=1 Scripts/bundle.sh > "$work/dev-sign.log" 2>&1 check grep -q -- "--sign $fingerprint --options runtime --timestamp=none" "$TEST_CODESIGN_LOG" check test ! -s "$work/dev-sign.log" check Scripts/check-bundle.sh --no-launch "$app" check test "$(library_validation_disabled)" = true check env TEST_TIMESTAMP_UNAVAILABLE=1 TEST_TEAM_IDENTIFIER=ABCDE12345 PARCEL_SIGN_IDENTITY='Developer ID Application: Fixture (ABCDE12345)' Scripts/bundle.sh > "$work/team-sign.log" 2>&1 check env TEST_TEAM_IDENTIFIER=ABCDE12345 Scripts/check-bundle.sh --no-launch "$app" check app_entitlements check test ! -s "$work/app-entitlements.plist" check grep -Fq -- '--sign Developer ID Application: Fixture (ABCDE12345) --options runtime --timestamp=none' "$TEST_CODESIGN_LOG" check env TEST_TEAM_IDENTIFIER=ABCDE12345 PARCEL_SIGN_IDENTITY='Developer ID Application: Fixture (ABCDE12345)' Scripts/bundle.sh release > "$work/team-release.log" 2>&1 check grep -Fq -- '--sign Developer ID Application: Fixture (ABCDE12345) --options runtime --timestamp ' "$TEST_CODESIGN_LOG" check fails env TEST_TIMESTAMP_UNAVAILABLE=1 TEST_TEAM_IDENTIFIER=ABCDE12345 PARCEL_SIGN_IDENTITY='Developer ID Application: Fixture (ABCDE12345)' Scripts/bundle.sh release check grep -q 'Timestamp service unavailable' "$work/failure.log" check codesign --verify --strict --deep "$app" check Scripts/bundle.sh > "$work/restored-sign.log" 2>&1 check Scripts/check-bundle.sh --no-launch "$app" check test "$(library_validation_disabled)" = true check fails env TEST_FAIL_FRAMEWORK_METADATA=1 Scripts/bundle.sh check grep -q 'Could not inspect framework signature' "$work/failure.log" check fails env TEST_MISSING_FRAMEWORK_TEAM=1 Scripts/bundle.sh check grep -q 'no team identifier metadata' "$work/failure.log" check fails env -u PARCEL_SIGN_IDENTITY TEST_IDENTITIES="$identities $identities" Scripts/bundle.sh check grep -q 'More than one Parcel Development identity' "$work/failure.log" check fails env -u PARCEL_SIGN_IDENTITY TEST_FAIL_SECURITY=1 Scripts/bundle.sh check env TEST_FAIL_SECURITY=1 Scripts/bundle.sh > "$work/override-sign.log" 2>&1 # Dedicated reality fixtures cover debug's helper; this probe checks release packaging. check Scripts/test-e2e.sh release check grep -q 'build --quiet -c release --product FixtureApp E2E=' "$TEST_SWIFT_LOG" check grep -Fq 'test -c release --no-parallel --xunit-output ' "$TEST_SWIFT_LOG" check grep -Fq ' --filter ^ParcelE2ETests\. E2E=1' "$TEST_SWIFT_LOG" check fails env TEST_FAIL_TEST=1 Scripts/test-e2e.sh release check fails Scripts/test-e2e.sh invalid check grep -q 'Usage:' "$work/failure.log" printf 'Packaging checks passed: %s\n' "$count"