forked from mplpl/mft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·66 lines (47 loc) · 1.72 KB
/
build.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
57
58
59
60
61
62
63
64
#!/bin/bash
FPATH="../mft $(date +'%Y-%m-%d %H-%M-%S')"
mkdir "$FPATH"
header () {
echo
echo
echo "**************************************************************"
echo "**************************************************************"
echo "Building $1"
echo "**************************************************************"
echo "**************************************************************"
echo
echo
}
header iOS
xcodebuild archive -scheme "mft ios" -destination "generic/platform=iOS" \
-archivePath "${FPATH}/mft_ios" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
if [ $? -ne 0 ]; then
echo "\n\n******** Error when building for iOS\n\n"
exit 1
fi
header "iOS Simulator"
xcodebuild archive -scheme "mft ios" -destination "generic/platform=iOS Simulator" \
-archivePath "${FPATH}/mft_sim" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
if [ $? -ne 0 ]; then
echo "\n\n******** Error when building for iOS Simulator\n\n"
exit 2
fi
header "macOS"
xcodebuild archive -scheme "mft" -destination "generic/platform=macOS" \
-archivePath "${FPATH}/mft_macos" SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
if [ $? -ne 0 ]; then
echo "\n\n******** Error when building for macOS\n\n"
exit 3
fi
header "XCFramework"
xcodebuild -create-xcframework \
-framework "${FPATH}/mft_ios.xcarchive/Products/Library/Frameworks/mft.framework" \
-framework "${FPATH}/mft_sim.xcarchive/Products/Library/Frameworks/mft.framework" \
-framework "${FPATH}/mft_macos.xcarchive/Products/Library/Frameworks/mft.framework" \
-output "${FPATH}/mft.xcframework"
if [ $? -ne 0 ]; then
echo "\n\n******** Error when building XCFramework\n\n"
exit 10
fi
echo "\n\nCheck out ${FPATH}"
header "All Done!"