-
Notifications
You must be signed in to change notification settings - Fork 2
/
step.sh
executable file
·75 lines (57 loc) · 1.49 KB
/
step.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
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# fail if any commands fails
#set -e
# TODO: fix CMD exits with error "Build: command not found" even though the file is created
# debug log
#set -x
CMD="xcodebuild"
if [ -n "${xcode_project_path}" ] ; then
CMD+=" -project ${xcode_project_path}"
else
echo "Error: xcode_project_path not set"
exit 1
fi
if [ -n "${xcode_scheme}" ] ; then
CMD+=" -scheme ${xcode_scheme}"
else
echo "Error: xcode_scheme not set"
exit 1
fi
if [ -n "${xcode_configuration}" ] ; then
CMD+=" -configuration ${xcode_configuration}"
else
echo "Error: xcode_configuration not set"
exit 1
fi
if [ -n "${xcode_sdk}" ] ; then
CMD+=" -sdk ${xcode_sdk}"
else
echo "Error: xcode_sdk not set"
exit 1
fi
IOSSIM_OUT_DIR=`pwd`/build
CMD+=" SYMROOT=${IOSSIM_OUT_DIR}"
#CMD+=" -verbose"
CMD+=" build"
echo ${CMD}
# build the simulator
`${CMD}`
# find the app
IOSSIM_APP_PATH=`find ${IOSSIM_OUT_DIR} -name "*.app"`
test -e ${OSSIM_APP_PATH} && echo ${OSSIM_APP_PATH}
IOSSIM_APP_DIR=`dirname ${IOSSIM_APP_PATH}`
IOSSIM_APP_FILE=`basename ${IOSSIM_APP_PATH}`
# compress the app directory
IOSSIM_ZIP_FILE="${xcode_scheme}-${xcode_configuration}.zip"
pushd ${IOSSIM_APP_DIR}
zip -r -q ${IOSSIM_ZIP_FILE} ${IOSSIM_APP_FILE}
IOSSIM_ZIP_PATH=`pwd`/${IOSSIM_ZIP_FILE}
popd
test -e ${IOSSIM_ZIP_PATH} || exit 1
if [ -d "${deploy_dir}" ]; then
cp -v ${IOSSIM_ZIP_PATH} ${deploy_dir}/
fi
if which envman >/dev/null; then
envman add --key IOSSIM_ZIP_PATH --value ${IOSSIM_ZIP_PATH}
fi
exit 0