-
Notifications
You must be signed in to change notification settings - Fork 0
/
_build.command
executable file
·66 lines (57 loc) · 1.53 KB
/
_build.command
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
#!/bin/bash
set -e
# macOS does not have realpath and readlink does not have -f option, so do this instead:
MY_DIR=$( cd "$(dirname "$0")" ; pwd -P )
cd "$MY_DIR"
if [ "${1:-}" == "--dirty" ]; then
dirty=true
shift
else
dirty=false
fi
if [ "$TERM" == "" ] || [ "$TERM" == "dumb" ] ; then
SMSO=""
RMSO=""
BEL=""
GREEN=""
RMGREEN=""
GRAY=""
RMGRAY=""
RED=""
RMRED=""
else
SMSO="$(tput smso)"
RMSO="$(tput rmso)"
BEL="$(tput bel)"
GREEN="$(tput smso; tput setaf 2)"
RMGREEN="$(tput rmso; tput sgr0)"
GRAY="$(tput smso; tput setaf 7)"
RMGRAY="$(tput rmso; tput sgr0)"
RED="$(tput setaf 9; tput smso)"
RMRED="$(tput rmso; tput sgr0)"
fi
echo ""
echo "$SMSO Build $RMSO"
echo ""
xcodebuild -workspace "${MY_DIR}/Sourcery.xcworkspace" -scheme "Sourcery-Release" -configuration Release -quiet CONFIGURATION_BUILD_DIR="${MY_DIR}/bin/build"
if [ "$dirty" = true ] ; then
echo ""
echo "$SMSO Copying (without cleaning)... $RMSO"
echo ""
rm -rf "${MY_DIR}/bin/Sourcery.app"
rm -rf "${MY_DIR}/bin/"*.dSYM
cp -Rf "${MY_DIR}/bin/build/Sourcery.app" "${MY_DIR}/bin/"
cp -Rf "${MY_DIR}/bin/build/"*.dSYM "${MY_DIR}/bin/"
else
echo ""
echo "$SMSO Clean up... $RMSO"
echo ""
rm -rf "${MY_DIR}/bin/Sourcery.app"
rm -rf "${MY_DIR}/bin/"*.dSYM
mv -f "${MY_DIR}/bin/build/Sourcery.app" "${MY_DIR}/bin/"
mv -f "${MY_DIR}/bin/build/"*.dSYM "${MY_DIR}/bin/"
rm -rf "${MY_DIR}/bin/build"
fi
echo ""
echo "$GREEN Done. $RMGREEN$BEL"
echo ""