-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate-xcframework.sh
More file actions
executable file
·55 lines (39 loc) · 1.34 KB
/
create-xcframework.sh
File metadata and controls
executable file
·55 lines (39 loc) · 1.34 KB
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
51
52
53
54
55
#!/bin/sh
ARCHIVE_DIRECTORY=build/archive
if [ $# -ne 1 ]
then
echo "Version is missing"
exit
fi
VERSION=$1
NAME=PinLayout
PROJECT=$NAME.xcodeproj
carthage bootstrap --platform iOS --use-xcframeworks --cache-builds
build() {
local FRAMEWORK_NAME=$1
echo "Building $FRAMEWORK_NAME"
xcodebuild archive \
-project $PROJECT \
-scheme $FRAMEWORK_NAME \
-destination "generic/platform=iOS" \
-archivePath "$ARCHIVE_DIRECTORY/$FRAMEWORK_NAME-iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcbeautify --disable-colored-output
xcodebuild archive \
-project $PROJECT \
-scheme $FRAMEWORK_NAME \
-destination "generic/platform=iOS Simulator" \
-archivePath "$ARCHIVE_DIRECTORY/$FRAMEWORK_NAME-iOS_Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES | xcbeautify --disable-colored-output
xcodebuild -create-xcframework \
-archive $ARCHIVE_DIRECTORY/${FRAMEWORK_NAME}-iOS.xcarchive -framework ${FRAMEWORK_NAME}.framework \
-archive $ARCHIVE_DIRECTORY/${FRAMEWORK_NAME}-iOS_Simulator.xcarchive -framework ${FRAMEWORK_NAME}.framework \
-output $ARCHIVE_DIRECTORY/${FRAMEWORK_NAME}.xcframework
}
build $NAME
mkdir build/xcframework
cp LICENSE $ARCHIVE_DIRECTORY
mkdir build/xcframework
cd $ARCHIVE_DIRECTORY
zip -r ../xcframework/$NAME-$VERSION.xcframework.zip $NAME.xcframework LICENSE