-
Notifications
You must be signed in to change notification settings - Fork 4
/
build-cap
executable file
·56 lines (46 loc) · 1.88 KB
/
build-cap
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
#!/usr/bin/env bash -eoux pipefail
build_capacitor_simulator() {
xcodebuild archive \
-scheme Capacitor \
-workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS Simulator" \
-archivePath ./Build/iOS-Simulator \
-configuration Release \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
}
build_capacitor_ios() {
xcodebuild archive \
-scheme Capacitor \
-workspace Capacitor.xcworkspace \
-destination "generic/platform=iOS" \
-archivePath ./Build/iOS \
SKIP_INSTALL=NO \
SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
}
create_xcframeworks() {
build_capacitor_simulator
build_capacitor_ios
rm -rf ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework/Frameworks
rm -rf ./Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework/Frameworks
xcodebuild -create-xcframework \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-debug-symbols $PWD/Build/iOS-Simulator.xcarchive/dSYMs/Capacitor.framework.dSYM \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Capacitor.framework \
-debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Capacitor.framework.dSYM \
-output Capacitor.xcframework
xcodebuild -create-xcframework \
-framework ./Build/iOS-Simulator.xcarchive/Products/Library/Frameworks/Cordova.framework \
-debug-symbols $PWD/Build/iOS-Simulator.xcarchive/dSYMs/Cordova.framework.dSYM \
-framework ./Build/iOS.xcarchive/Products/Library/Frameworks/Cordova.framework \
-debug-symbols $PWD/Build/iOS.xcarchive/dSYMs/Cordova.framework.dSYM \
-output Cordova.xcframework
}
git clone https://github.com/ionic-team/capacitor capacitor-checkout
cd capacitor-checkout/ios/Capacitor
git checkout $1
create_xcframeworks
mv Capacitor.xcframework ../../../
mv Cordova.xcframework ../../../