forked from AgileManufacturing/HUniversal-Production-Utrecht
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrexos-build.sh
64 lines (56 loc) · 1.43 KB
/
rexos-build.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
#!/usr/bin/env sh
REXOS_BUILD_TARGET=""
ROS_ONLY=false
MAS_ONLY=false
function usage() {
echo "Builds or cleans the cpp and java parts for the REXOS project."
echo "Usage: source rexos-build.sh [-c] [-r] [-m]"
echo "Defaults to build both ROS and MAS. Use -c to clean, -r to only build ROS, and -m to only build MAS."
}
#Have to clear OPTIND because this file as sourced and OPTIND is only cleared when creating a new shell.
OPTIND=0
while getopts ":chrm" opt; do
case $opt in
c)
REXOS_BUILD_TARGET="clean"
;;
h)
usage
return
;;
r)
ROS_ONLY=true
;;
m)
MAS_ONLY=true
;;
\?)
usage
return
;;
esac
done
echo -e "\033[36m===== Setting ROS_PACKAGE_PATH =====\033[0m"
. ./.export-rospath
if [ "$MAS_ONLY" == false ] || [ "$ROS_ONLY" == true ];
then
echo -e "\033[36m===== Building C++ =====\033[0m"
catkin_make $REXOS_BUILD_TARGET
echo -e "\033[35m===== DONE BUILDING C++ =====\033[0m"
if [ "$REXOS_BUILD_TARGET" != "clean" ];
then
. ./devel/setup.sh
fi
#rosrun apparently caches its module list. Force an update so tab complete works.
rospack list > /dev/null
fi
echo ""
if [ "$ROS_ONLY" == false ] || [ "$MAS_ONLY" == true ];
then
echo -e "\033[36m===== Building JAVA =====\033[0m"
ant $REXOS_BUILD_TARGET
echo -e "\033[35m===== DONE JAVA =====\033[0m"
fi
#Have to clear OPTIND because this file as sourced and OPTIND is only cleared when creating a new shell.
OPTIND=0
unset REXOS_BUILD_TARGET