-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxcframework.sh
executable file
·43 lines (38 loc) · 1.26 KB
/
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
echo "Cleaning..."
rm -rf ./build
rm -rf ./Binary
rm -rf ./*.xcframework
echo "Archiving..."
# build framework for iOS
xcodebuild archive \
-scheme SwiftDemangle \
-destination "generic/platform=iOS" \
-archivePath "./build/ios.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# build framework for iOS Simulator
xcodebuild archive \
-scheme SwiftDemangle \
-destination "generic/platform=iOS Simulator" \
-archivePath "./build/ios-simulator.xcarchive" \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# build framework for macOS
xcodebuild archive \
-scheme SwiftDemangle \
-destination "generic/platform=macOS" \
-archivePath "./build/macos.xcarchive" \
-sdk macosx \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
echo "Create XCFramework"
# create XCFramework
xcodebuild -create-xcframework \
-framework "./build/ios.xcarchive/Products/usr/local/lib/SwiftDemangle.framework" \
-framework "./build/ios-simulator.xcarchive/Products/usr/local/lib/SwiftDemangle.framework" \
-framework "./build/macos.xcarchive/Products/usr/local/lib/SwiftDemangle.framework" \
-output "./SwiftDemangle.xcframework"
echo "Cleaning..."
rm -rf ./build