From 5a945d1750880f7ae17366ecb2d8862291be303c Mon Sep 17 00:00:00 2001 From: fermoya Date: Tue, 16 Nov 2021 11:14:46 +0000 Subject: [PATCH] Fix issue when archiving catalyst --- scripts/build_xcframework.sh | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/scripts/build_xcframework.sh b/scripts/build_xcframework.sh index 416b18c..6d3e75b 100755 --- a/scripts/build_xcframework.sh +++ b/scripts/build_xcframework.sh @@ -12,7 +12,7 @@ rm $XCFRAMEWORK_ZIP_PATH SCHEMES=( SwiftUIPager_Catalyst SwiftUIPager_macOS SwiftUIPager_iOS SwiftUIPager_watchOS SwiftUIPager_tvOS ) PLATFORMS=( - "platform=macOS,variant=Mac Catalyst" + "" "platform=macOS" "generic/platform=iOS;generic/platform=iOS Simulator" "generic/platform=watchOS;generic/platform=watchOS Simulator" @@ -28,18 +28,27 @@ ARCHIVES=( COMMAND="xcodebuild -create-xcframework " xcodebuild clean -project $PROJ_PATH + for i in ${!SCHEMES[@]}; do IFS=";" read -r -a PLATFORM <<< "${PLATFORMS[i]}" IFS=";" read -r -a ARCHIVE <<< "${ARCHIVES[i]}" - - for j in ${!PLATFORM[@]}; do + + for j in ${!ARCHIVE[@]}; do ARCHIVE_PATH="$FRAMEWORKS_PATH/${ARCHIVE[$j]}" - xcodebuild archive -scheme ${SCHEMES[$i]} \ - -project $PROJ_PATH \ - -destination "${PLATFORM[$j]}" \ - -archivePath $ARCHIVE_PATH \ - SKIP_INSTALL=NO \ - BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + if [ -z "${PLATFORM[$j]}"]; then + xcodebuild archive -scheme ${SCHEMES[$i]} \ + -project $PROJ_PATH \ + -archivePath $ARCHIVE_PATH \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + else + xcodebuild archive -scheme ${SCHEMES[$i]} \ + -project $PROJ_PATH \ + -destination "${PLATFORM[$j]}" \ + -archivePath $ARCHIVE_PATH \ + SKIP_INSTALL=NO \ + BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcpretty + fi COMMAND="$COMMAND -framework $ARCHIVE_PATH/Products/Library/Frameworks/$LIB_NAME.framework" done