-
Notifications
You must be signed in to change notification settings - Fork 26
/
b
executable file
·103 lines (93 loc) · 1.77 KB
/
b
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
NUMCORES=`nproc`
retval=1
args=$*
pretty=~/bin/prettyfier
if [ -f b ]; then
$pretty bash ./b $*
retval=$?
exit $retval
fi
if [ -f b.py ]; then
python3 ./b $*
retval=$?
exit $retval
fi
# short arguments
if [[ $# > 0 ]]; then
case $1 in
cv)
shift
args="checkVerbose $*"
;;
c|t)
shift
args="check $*"
;;
d)
shift
args="doc $*"
;;
cl|cc)
shift
args="clean $*"
;;
u)
shift
args="unit $*"
;;
ugdb)
shift
pretty=
args="unit-gdb $*"
;;
i)
shift
args="install $*"
;;
r)
shift
args="run $*"
;;
f)
shift
args="format $*"
;;
p)
shift
args="package $*"
;;
g|gdb)
shift
args="gdb $*"
pretty=
;;
esac
fi
# execute right build system
if [ -f build/build.ninja ]; then
cd build
$pretty ninja -j$NUMCORES $args
retval=$?
cd ..
elif [ -f build/Makefile ]; then
cd build
$pretty make -j$NUMCORES $args
retval=$?
cd ..
elif [ -f build.ninja ]; then
$pretty ninja -j$NUMCORES $args
retval=$?
elif [ -f Makefile ]; then
$pretty make -j$NUMCORES $args
retval=$?
elif [ -f pom.xml ]; then
export MAVEN_OPTS=-Dfile.encoding=ISO-8859-1
export JAVA_TOOL_OPTIONS=-Dfile.encoding=ISO-8859-1
$pretty mvn $args -Dmaven.test.skip=true
retval=$?
else
echo "could not identify build system"
exit 1
fi
exit $retval