-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-rebuild.sh
executable file
·75 lines (64 loc) · 1.35 KB
/
run-rebuild.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
testRoot=`pwd`
rclcppRoot=${testRoot}/rclcpp_node
rclexRoot=${testRoot}/rclex_node
if [ $# -eq 0 ];
then
build_rclcpp=1
build_rclex=1
else
if [ "$1" == "rclcpp" ];
then
build_rclcpp=1
build_rclex=0
elif [ "$1" == "rclex" ];
then
build_rclcpp=0
build_rclex=1
else
echo "ERROR: invalid option: ${1}"
exit 1
fi
fi
# Rebuild Rclcpp node
if [ ${build_rclcpp} -eq 1 ];
then
echo "INFO: building rclcpp node in ${rclcppRoot}"
cd $rclcppRoot
rm -rf build install log
colcon build
result=$?
if [ $result -ne 0 ];
then
echo "ERROR: \`colcon build\` for Rclcpp failed: $result"
exit $result
fi
fi
# Rebuild Rclex node
if [ ${build_rclex} -eq 1 ];
then
echo "INFO: building rclex node in ${rclexRoot}"
cd $rclexRoot
rm -rf _build deps
mix deps.get
result=$?
if [ $result -ne 0 ];
then
echo "ERROR: \`mix deps.get\` for Rclex failed: $result"
exit $result
fi
mix rclex.gen.msgs
result=$?
if [ $result -ne 0 ];
then
echo "ERROR: \`mix rclex.gen.msgs\` for Rclex failed: $result"
exit $result
fi
mix compile
result=$?
if [ $result -ne 0 ];
then
echo "ERROR: \`mix compile\` for Rclex failed: $result"
exit $result
fi
fi