Skip to content

Commit

Permalink
Fix issue when archiving catalyst
Browse files Browse the repository at this point in the history
  • Loading branch information
fermoya committed Nov 16, 2021
1 parent 7f9b866 commit eb824ff
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions scripts/build_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit eb824ff

Please sign in to comment.