Skip to content

Commit

Permalink
Merge pull request #150 from fermoya/feat/extract-ci-scripts
Browse files Browse the repository at this point in the history
Fixed macos build
  • Loading branch information
fermoya authored Nov 2, 2020
2 parents 83a94a9 + a8fcbad commit 526c6bc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
4 changes: 2 additions & 2 deletions SwiftUIPager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/SwiftUIPager/Info-macOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/SwiftUIPager/SupportFiles/Info-macOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -723,7 +723,7 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/SwiftUIPager/Info-macOS.plist";
INFOPLIST_FILE = "$(SRCROOT)/SwiftUIPager/SupportFiles/Info-macOS.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
13 changes: 2 additions & 11 deletions scripts/build_platforms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@ gem install xcpretty

SCHEMES=( SwiftUIPager_Catalyst SwiftUIPager_macOS SwiftUIPager_iOS SwiftUIPager_watchOS SwiftUIPager_tvOS )
PLATFORMS=( "platform=macOS,variant=Mac Catalyst" "platform=macOS" "generic/platform=iOS" "generic/platform=watchOS" "generic/platform=tvOS" )
DIR=$(xcodebuild -project SwiftUIPager.xcodeproj -showBuildSettings | grep -m 1 "BUILD_DIR" | grep -oEi "\/.*")
rm -rd $DIR

rm -rd $DIR
for i in ${!SCHEMES[@]}; do
xcodebuild clean build -scheme ${SCHEMES[$i]} \
-project SwiftUIPager.xcodeproj \
-destination "${PLATFORMS[$i]}" | xcpretty

COUNT=$(find $DIR -maxdepth 1 -type d | wc -l)
if [ $COUNT -eq 2 ]; then
echo "$(tput setaf 2)Build succeded for target ${SCHEMES[$i]}$(tput sgr0)"
else
echo "$(tput setaf 1)Build failed for target ${SCHEMES[$i]}$(tput sgr0)"
exit 1
fi
-destination "${PLATFORMS[$i]}" || exit 1
done
10 changes: 5 additions & 5 deletions scripts/build_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ PLATFORMS=(
ARCHIVES=(
"$LIB_NAME.macCatalyst.xcarchive"
"$LIB_NAME.macos.xcarchive"
"$LIB_NAME.iOS.xcarchive;SwiftUIPager.iOS-simulator.xcarchive"
"$LIB_NAME.watchOS.xcarchive;SwiftUIPager.watchOS-simulator.xcarchive"
"$LIB_NAME.tvOS.xcarchive;SwiftUIPager.tvOS-simulator.xcarchive"
"$LIB_NAME.iOS.xcarchive;$LIB_NAME.iOS-simulator.xcarchive"
"$LIB_NAME.watchOS.xcarchive;$LIB_NAME.watchOS-simulator.xcarchive"
"$LIB_NAME.tvOS.xcarchive;$LIB_NAME.tvOS-simulator.xcarchive"
)

COMMAND="xcodebuild -create-xcframework "
Expand Down Expand Up @@ -51,5 +51,5 @@ rm -rd $FRAMEWORKS_PATH
cd $BUILD_PATH
zip -r -X $XCFRAMEWORK_ZIP $XCFRAMEWORK_NAME
rm -rd $XCFRAMEWORK_NAME
echo ::set-output name=path::$XCFRAMEWORK_ZIP_PATH
cd ..
cd ..
echo ::set-output name=path::$XCFRAMEWORK_ZIP_PATH

0 comments on commit 526c6bc

Please sign in to comment.