-
-
Notifications
You must be signed in to change notification settings - Fork 781
/
build_xcframework.sh
executable file
·50 lines (39 loc) · 1.66 KB
/
build_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
50
#!/bin/bash
PROJECT_FILE="LTMorphingLabelDemo.xcodeproj"
SCHEME="MorphingLabel"
BUILD_FOLDER="Build/MorphingLabel"
mkdir -p Build
# iOS Simulator
xcodebuild archive -project "$PROJECT_FILE" -scheme "$SCHEME" -configuration Release \
-archivePath "$BUILD_FOLDER/Simulator" \
-sdk iphonesimulator \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# iOS
xcodebuild archive -project "$PROJECT_FILE" -scheme "$SCHEME" -configuration Release \
-archivePath "$BUILD_FOLDER/iOS" \
-sdk iphoneos \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# tvOS
xcodebuild archive -project "$PROJECT_FILE" -scheme "$SCHEME" -configuration Release \
-archivePath "$BUILD_FOLDER/tvOS" \
-sdk appletvos \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# tvOS Simulator
xcodebuild archive -project "$PROJECT_FILE" -scheme "$SCHEME" -configuration Release \
-archivePath "$BUILD_FOLDER/tvOSSimulator" \
-sdk appletvsimulator \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# XCFramework
xcodebuild -create-xcframework \
-framework "$BUILD_FOLDER/iOS.xcarchive/Products/Library/Frameworks/MorphingLabel.framework" \
-framework "$BUILD_FOLDER/tvOS.xcarchive/Products/Library/Frameworks/MorphingLabel.framework" \
-framework "$BUILD_FOLDER/Simulator.xcarchive/Products/Library/Frameworks/MorphingLabel.framework" \
-framework "$BUILD_FOLDER/tvOSSimulator.xcarchive/Products/Library/Frameworks/MorphingLabel.framework" \
-output Build/LTMorphingLabel.xcframework
cd Build
# Compress
zip -vry LTMorphingLabel.xcframework.zip LTMorphingLabel.xcframework/ -x "*.DS_Store"
# Checksum for Package.swift
swift package compute-checksum LTMorphingLabel.xcframework.zip
# Open in Finder
open ./