forked from krzyzanowskim/CryptoSwift
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (21 loc) · 1013 Bytes
/
build.sh
File metadata and controls
executable file
·30 lines (21 loc) · 1013 Bytes
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
#!/bin/sh
TARGET_NAME="CryptoSwift iOS"
FRAMEWORK_NAME="CryptoSwift"
INSTALL_DIR="Frameworks/iOS"
FRAMEWORK="${INSTALL_DIR}/${FRAMEWORK_NAME}.framework"
if [ -d "${INSTALL_DIR}" ]
then
rm -rf "${INSTALL_DIR}"
fi
mkdir -p "${INSTALL_DIR}"
WRK_DIR="build"
DEVICE_DIR="${WRK_DIR}/Release-iphoneos/${FRAMEWORK_NAME}.framework"
SIMULATOR_DIR="${WRK_DIR}/Release-iphonesimulator/${FRAMEWORK_NAME}.framework"
xcodebuild -configuration "Release" -target "${TARGET_NAME}" -sdk iphoneos SYMROOT=$(PWD)/${WRK_DIR}
xcodebuild -configuration "Release" -target "${TARGET_NAME}" -sdk iphonesimulator SYMROOT=$(PWD)/${WRK_DIR}
lipo -create "${DEVICE_DIR}/${FRAMEWORK_NAME}" "${SIMULATOR_DIR}/${FRAMEWORK_NAME}" -output "${DEVICE_DIR}/${FRAMEWORK_NAME}"
cp -R "${DEVICE_DIR}" "${INSTALL_DIR}/"
if [ -d "${SIMULATOR_DIR}/Modules/${FRAMEWORK_NAME}.swiftmodule/" ]; then
cp -f -R "${SIMULATOR_DIR}/Modules/${FRAMEWORK_NAME}.swiftmodule/" "${FRAMEWORK}/Modules/${FRAMEWORK_NAME}.swiftmodule/" | echo
fi
rm -r "${WRK_DIR}"