-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathbuild_framework.sh
More file actions
executable file
·138 lines (122 loc) · 4.54 KB
/
build_framework.sh
File metadata and controls
executable file
·138 lines (122 loc) · 4.54 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
CLEAR='\033[0m'
RED='\033[0;31m'
function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi
echo "Usage: $0 [-t target] [-c configuration]"
echo " -c, --configuration Configuration (Debug / Release)"
echo ""
echo "Example: $0 --configuration Debug"
exit 1
}
# parse params
while [[ "$#" > 0 ]]; do case $1 in
-c|--configuration) CONFIGURATION="$2";shift;shift;;
*) usage "Unknown parameter passed: $1"; shift; shift;;
esac; done
# verify params
if [ -z "$CONFIGURATION" ]; then usage "Configuration is not set."; fi;
echo -e "Build Rive Framework"
echo -e "Configuration -> ${CONFIGURATION}"
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-destination generic/platform=iOS \
-archivePath ".build/archives/RiveRuntime_iOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-destination "generic/platform=iOS Simulator" \
-archivePath ".build/archives/RiveRuntime_iOS_Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-sdk xros \
-destination generic/platform=visionOS \
-archivePath ".build/archives/RiveRuntime_visionOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-sdk xrsimulator \
-destination "generic/platform=visionOS Simulator" \
-archivePath ".build/archives/RiveRuntime_visionOS_Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-sdk appletvos \
-destination generic/platform=tvOS \
-archivePath ".build/archives/RiveRuntime_tvOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-sdk appletvsimulator \
-destination "generic/platform=tvOS Simulator" \
-archivePath ".build/archives/RiveRuntime_tvOS_Simulator" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive \
-configuration ${CONFIGURATION} \
-project RiveRuntime.xcodeproj \
-scheme RiveRuntime \
-destination "generic/platform=macOS" \
-archivePath ".build/archives/RiveRuntime_macOS" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
SUPPORTS_MACCATALYST=NO
xcodebuild archive \
-configuration "${CONFIGURATION} (Catalyst)" \
-project RiveRuntime.xcodeproj \
-scheme "RiveRuntime (Catalyst)" \
-destination "generic/platform=macOS,variant=Mac Catalyst" \
-archivePath ".build/archives/RiveRuntime_macOS_Catalyst" \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
xcodebuild \
-create-xcframework \
-archive .build/archives/RiveRuntime_iOS.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_iOS_Simulator.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_visionOS.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_visionOS_Simulator.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_tvOS.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_tvOS_Simulator.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_macOS.xcarchive \
-framework RiveRuntime.framework \
-archive .build/archives/RiveRuntime_macOS_Catalyst.xcarchive \
-framework RiveRuntime.framework \
-output archive/RiveRuntime.xcframework
# Strip the `module RiveRuntime.Swift { ... }` block from every modulemap in the
# XCFramework. The Swift build phase unconditionally appends this block, which
# bakes in C++ interop type definitions for the Swift version used to build the
# XCFramework. Consumers using a different Xcode/Swift version see conflicting
# definitions and get ODR errors. Removing the block prevents Clang from ever
# loading the stale header.
echo "Stripping RiveRuntime.Swift submodule from XCFramework modulemaps..."
find archive/RiveRuntime.xcframework -name "module.modulemap" | while read -r map; do
perl -0777 -i -pe 's/\n*^module RiveRuntime\.Swift \{[^}]*\}\n?//mg' "$map"
echo " Patched: $map"
done
echo "Done."