#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" TASK_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/sub-banner-check.XXXXXX")" export TMPDIR="$TASK_ROOT" NODE_COMPILE_CACHE="$TASK_ROOT/node" BUN_RUNTIME_TRANSPILER_CACHE_PATH="$TASK_ROOT/bun" trap 'rm -rf "$TASK_ROOT"' EXIT if [[ "${1:-}" == --ui ]]; then MODULES=("$HOME"/Library/Developer/Xcode/DerivedData/SodaLive-*/Build/Products/Debug-iphonesimulator/Kingfisher.swiftmodule) MODULE_PATH="${KINGFISHER_MODULE_PATH:-$(dirname "${MODULES[0]}")}" xcrun swiftc -swift-version 5 -typecheck -D SB_UI_CHECK \ -sdk "$(xcrun --sdk iphonesimulator --show-sdk-path)" -target x86_64-apple-ios16.6-simulator \ -module-cache-path "$TASK_ROOT/modules" -I "$MODULE_PATH" \ "$ROOT/SodaLive/Sources/V2/Component/Banner/SubBanner"*.swift \ "$ROOT/SodaLive/Sources/UI/Theme/"{Color,Spacing}.swift \ "$ROOT/SodaLive/Sources/Extensions/"{ColorExtension,FontModifier}.swift \ "$ROOT/work/tests/SubBannerCheck.swift" printf '%s\n' 'PASS: production carousel/model/UIKit opener iOS16.6 typecheck with installed Kingfisher and real theme/font files' exit fi swiftc -swift-version 5 -module-cache-path "$TASK_ROOT/modules" \ -D SB_MOYA_DOUBLE -emit-module -emit-library -module-name Moya \ "$ROOT/work/tests/SubBannerCheck.swift" -o "$TASK_ROOT/libMoya.dylib" swiftc -swift-version 5 -module-cache-path "$TASK_ROOT/modules" \ -I "$TASK_ROOT" -L "$TASK_ROOT" -lMoya \ -D SB_COMBINE_MOYA_DOUBLE -emit-module -emit-library -module-name CombineMoya \ "$ROOT/work/tests/SubBannerCheck.swift" -o "$TASK_ROOT/libCombineMoya.dylib" swiftc -swift-version 5 -module-cache-path "$TASK_ROOT/modules" \ "$ROOT/SodaLive/Sources/V2/Component/Banner/SubBanner.swift" \ "$ROOT/SodaLive/Sources/V2/Component/Banner/SubBannerLinkOpener.swift" \ -I "$TASK_ROOT" -L "$TASK_ROOT" -lMoya -lCombineMoya \ -Xlinker -rpath -Xlinker "$TASK_ROOT" \ "$ROOT/SodaLive/Sources/V2/Main/Home/Recommendation/Repository/"*.swift \ "$ROOT/SodaLive/Sources/V2/Main/Home/Recommendation/Models/"*.swift \ "$ROOT/SodaLive/Sources/V2/Main/Home/Recommendation/MainHomeRecommendationViewModel.swift" \ "$ROOT/SodaLive/Sources/V2/Main/Content/Recommendation/Repository/"*.swift \ "$ROOT/SodaLive/Sources/V2/Main/Content/Recommendation/Models/AudioRecommendationsResponse.swift" \ "$ROOT/SodaLive/Sources/V2/Main/Content/Recommendation/MainContentRecommendationViewModel.swift" \ "$ROOT/SodaLive/Sources/Settings/Event/Event.swift" \ "$ROOT/SodaLive/Sources/Common/ApiResponse.swift" \ "$ROOT/SodaLive/Sources/Common/ApiResponseWithoutData.swift" \ "$ROOT/SodaLive/Sources/Extensions/UserDefaultsExtension.swift" \ "$ROOT/work/tests/SubBannerCheck.swift" -o "$TASK_ROOT/check-sub-banners" "$TASK_ROOT/check-sub-banners" "$@"