-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsim-prepare.sh
executable file
·61 lines (46 loc) · 1.5 KB
/
sim-prepare.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
#!/usr/bin/env bash
if which rbenv > /dev/null; then
RBENV_EXEC="rbenv exec"
else
RBENV_EXEC=
fi
${RBENV_EXEC} bundle install
TARGET_NAME="Briar-cal"
XC_WORKSPACE="../briar-ios-example.xcworkspace"
XC_SCHEME="${TARGET_NAME}"
CAL_BUILD_CONFIG=Debug
CAL_BUILD_DIR="${PWD}/build/jenkins"
rm -rf "${TARGET_NAME}.app"
rm -rf "${CAL_BUILD_DIR}"
mkdir -p "${CAL_BUILD_DIR}"
####################### JENKINS KEYCHAIN #######################################
echo "INFO: unlocking the keychain"
if [ "${USER}" = "jenkins" ]; then
xcrun security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_PATH}"
RETVAL=$?
if [ ${RETVAL} != 0 ]; then
echo "FAIL: could not unlock the keychain"
exit ${RETVAL}
fi
xcrun security set-keychain-settings -t 3600 -l "${KEYCHAIN_PATH}"
OTHER_CODE_SIGN_FLAGS="--keychain=${KEYCHAIN_PATH}"
xcrun security show-keychain-info ${KEYCHAIN_PATH}
fi
xcrun xcodebuild \
OTHER_CODE_SIGN_FLAGS=${OTHER_CODE_SIGN_FLAGS} \
-SYMROOT="${CAL_BUILD_DIR}" \
-derivedDataPath "${CAL_BUILD_DIR}" \
-workspace "${XC_WORKSPACE}" \
-scheme "${TARGET_NAME}" \
-sdk iphonesimulator \
-configuration "${CAL_BUILD_CONFIG}" \
clean build | xcpretty -c
RETVAL=${PIPESTATUS[0]}
if [ ${RETVAL} != 0 ]; then
echo "FAIL: could not build"
exit ${RETVAL}
else
echo "INFO: successfully built"
fi
cp -r "${CAL_BUILD_DIR}/Build/Products/${CAL_BUILD_CONFIG}-iphonesimulator/${TARGET_NAME}.app" ./
echo "export APP=${PWD}/${TARGET_NAME}.app"