-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
generate_static_library.sh
executable file
·58 lines (47 loc) · 2.06 KB
/
generate_static_library.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
51
52
53
54
55
56
#!/bin/bash
SCHEME=${1:-godot_plugin}
PROJECT=${2:-godot_plugin.xcodeproj}
OUT=godot_example
CLASS=PluginExample
xcodebuild archive \
-project "./$PROJECT" \
-scheme $SCHEME \
-archivePath "./bin/ios_release.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO \
GCC_PREPROCESSOR_DEFINITIONS="PluginClass=${CLASS}"
xcodebuild archive \
-project "./$PROJECT" \
-scheme $SCHEME \
-archivePath "./bin/sim_release.xcarchive" \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
GCC_PREPROCESSOR_DEFINITIONS="PluginClass=${CLASS}"
xcodebuild archive \
-project "./$PROJECT" \
-scheme $SCHEME \
-archivePath "./bin/ios_debug.xcarchive" \
-sdk iphoneos \
SKIP_INSTALL=NO \
GCC_PREPROCESSOR_DEFINITIONS="DEBUG_ENABLED=1 PluginClass=${CLASS}"
xcodebuild archive \
-project "./$PROJECT" \
-scheme $SCHEME \
-archivePath "./bin/sim_debug.xcarchive" \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
GCC_PREPROCESSOR_DEFINITIONS="DEBUG_ENABLED=1 PluginClass=${CLASS}"
mv "./bin/ios_release.xcarchive/Products/usr/local/lib/lib${SCHEME}.a" "./bin/ios_release.xcarchive/Products/usr/local/lib/${OUT}.a"
mv "./bin/sim_release.xcarchive/Products/usr/local/lib/lib${SCHEME}.a" "./bin/sim_release.xcarchive/Products/usr/local/lib/${OUT}.a"
mv "./bin/ios_debug.xcarchive/Products/usr/local/lib/lib${SCHEME}.a" "./bin/ios_debug.xcarchive/Products/usr/local/lib/${OUT}.a"
mv "./bin/sim_debug.xcarchive/Products/usr/local/lib/lib${SCHEME}.a" "./bin/sim_debug.xcarchive/Products/usr/local/lib/${OUT}.a"
rm -rf "./bin/${OUT}.release.xcframework"
rm -rf "./bin/${OUT}.debug.xcframework"
xcodebuild -create-xcframework \
-library "./bin/ios_release.xcarchive/Products/usr/local/lib/${OUT}.a" \
-library "./bin/sim_release.xcarchive/Products/usr/local/lib/${OUT}.a" \
-output "./bin/${OUT}.release.xcframework"
xcodebuild -create-xcframework \
-library "./bin/ios_debug.xcarchive/Products/usr/local/lib/${OUT}.a" \
-library "./bin/sim_debug.xcarchive/Products/usr/local/lib/${OUT}.a" \
-output "./bin/${OUT}.debug.xcframework"