-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-universal-framework.sh
More file actions
executable file
·47 lines (40 loc) · 1.7 KB
/
build-universal-framework.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.7 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
# create folder where we place built frameworks
rm -r build
mkdir build
# build framework for simulators
xcodebuild clean build \
-project FanFindSDK.xcodeproj \
-scheme FanFindSDK \
-configuration Release \
-sdk iphonesimulator \
-derivedDataPath derived_data \
EXCLUDED_ARCHS="arm64"
# create folder to store compiled framework for simulator
mkdir build/simulator
# copy compiled framework for simulator into our build folder
cp -r derived_data/Build/Products/Release-iphonesimulator/FanFindSDK.framework build/simulator
#build framework for devices
xcodebuild clean build \
-project FanFindSDK.xcodeproj \
-scheme FanFindSDK \
-configuration Release \
-sdk iphoneos \
-derivedDataPath derived_data
# create folder to store compiled framework for simulator
mkdir build/devices
# copy compiled framework for simulator into our build folder
cp -r derived_data/Build/Products/Release-iphoneos/FanFindSDK.framework build/devices
# create folder to store compiled universal framework
mkdir build/universal
####################### Create universal framework #############################
# copy device framework into universal folder
echo "Copying iphone output"
cp -r build/devices/FanFindSDK.framework build/universal/
# create framework binary compatible with simulators and devices, and replace binary in unviersal framework
echo "Creating universal package"
lipo -create \
build/simulator/FanFindSDK.framework/FanFindSDK \
build/devices/FanFindSDK.framework/FanFindSDK \
-output build/universal/FanFindSDK.framework/FanFindSDK
# copy simulator Swift public interface to universal framework
cp -r build/simulator/FanFindSDK.framework/Modules/FanFindSDK.swiftmodule/* build/universal/FanFindSDK.framework/Modules/FanFindSDK.swiftmodule