forked from abdullahselek/Swifty360Player
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-framework.sh
More file actions
executable file
·56 lines (43 loc) · 1.86 KB
/
build-framework.sh
File metadata and controls
executable file
·56 lines (43 loc) · 1.86 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
#!/usr/bin/env bash
set -e
BASE_PWD="$PWD"
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
OUTPUT_DIR=$( mktemp -d )
COMMON_SETUP="-project ${SCRIPT_DIR}/../Swifty360Player.xcodeproj -scheme Swifty360Player -configuration Release -quiet SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES"
# macOS Catalyst
DERIVED_DATA_PATH=$( mktemp -d )
xcrun xcodebuild build \
$COMMON_SETUP \
-derivedDataPath "${DERIVED_DATA_PATH}" \
-destination 'generic/platform=macOS,variant=Mac Catalyst'
mkdir -p "${OUTPUT_DIR}/maccatalyst"
cp -r "${DERIVED_DATA_PATH}/Build/Products/Release-maccatalyst/Swifty360Player.framework" "${OUTPUT_DIR}/maccatalyst"
rm -rf "${DERIVED_DATA_PATH}"
# iOS
DERIVED_DATA_PATH=$( mktemp -d )
xcrun xcodebuild build \
$COMMON_SETUP \
-derivedDataPath "${DERIVED_DATA_PATH}" \
-destination 'generic/platform=iOS'
mkdir -p "${OUTPUT_DIR}/iphoneos"
cp -r "${DERIVED_DATA_PATH}/Build/Products/Release-iphoneos/Swifty360Player.framework" "${OUTPUT_DIR}/iphoneos"
rm -rf "${DERIVED_DATA_PATH}"
# iOS Simulator
DERIVED_DATA_PATH=$( mktemp -d )
xcrun xcodebuild build \
$COMMON_SETUP \
-derivedDataPath "${DERIVED_DATA_PATH}" \
-destination 'generic/platform=iOS Simulator'
mkdir -p "${OUTPUT_DIR}/iphonesimulator"
cp -r "${DERIVED_DATA_PATH}/Build/Products/Release-iphonesimulator/Swifty360Player.framework" "${OUTPUT_DIR}/iphonesimulator"
rm -rf "${DERIVED_DATA_PATH}"
# XCFRAMEWORK
xcrun xcodebuild -create-xcframework \
-framework "${OUTPUT_DIR}/iphoneos/Swifty360Player.framework" \
-framework "${OUTPUT_DIR}/iphonesimulator/Swifty360Player.framework" \
-framework "${OUTPUT_DIR}/maccatalyst/Swifty360Player.framework" \
-output ${OUTPUT_DIR}/Swifty360Player.xcframework
ditto -c -k --keepParent ${OUTPUT_DIR}/Swifty360Player.xcframework Swifty360Player.xcframework.zip
echo "✔️ Swifty360Player.xcframework"
rm -rf ${OUTPUT_DIR}
cd ${BASE_PWD}