-
Notifications
You must be signed in to change notification settings - Fork 31
/
make-xcframework.sh
executable file
·49 lines (38 loc) · 2.95 KB
/
make-xcframework.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#set -x # Debug
set -e # Exit on error
moduleName="GLTFKit2"
outputDirectory="$(pwd;)/$moduleName.xcframework"
archiveDirectoryName="archives"
archiveDirectory="$(pwd;)/$archiveDirectoryName"
rm -rf $archiveDirectory
rm -rf $outputDirectory
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/iOS/$moduleName" \
-destination "generic/platform=iOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/iOS_Simulator/$moduleName" \
-destination "generic/platform=iOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/tvOS/$moduleName" \
-destination "generic/platform=tvOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/tvOS_Simulator/$moduleName" \
-destination "generic/platform=tvOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/macOS/$moduleName" \
-destination "generic/platform=macOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/macOS_Catalyst/$moduleName" \
-destination "generic/platform=macOS,variant=Mac Catalyst" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/visionOS/$moduleName" \
-destination "generic/platform=visionOS" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -scheme $moduleName -archivePath "$archiveDirectory/visionOS_Simulator/$moduleName" \
-destination "generic/platform=visionOS Simulator" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework \
-archive "$archiveDirectory/iOS/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/iOS_Simulator/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/tvOS/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/tvOS_Simulator/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/macOS/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/macOS_Catalyst/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/visionOS/$moduleName.xcarchive" -framework $moduleName.framework \
-archive "$archiveDirectory/visionOS_Simulator/$moduleName.xcarchive" -framework $moduleName.framework \
-output $outputDirectory
rm -rf $archiveDirectory
ditto -c -k --sequesterRsrc --keepParent GLTFKit2.xcframework GLTFKit2.xcframework.zip
swift package compute-checksum GLTFKit2.xcframework.zip