-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.sh
executable file
·54 lines (47 loc) · 1.32 KB
/
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
#!/bin/bash
# A convenience script used to build our code within the workplace you are in .
# When used to clean, argument 1 should be clean, and argument 2, if present should be "all" specifying to clean all workspaces.
# If argument 2 is omitted when cleaning, then the current workspace will be cleaned.
set -e
# Handle cleaning
if [[ "$1" == "clean" ]]; then
if [[ "$2" == "all" ]]; then
cd onboard/catkin_ws
catkin clean -y
cd ../..
cd landside/catkin_ws
catkin clean -y
cd ../..
cd core/catkin_ws
catkin clean -y
cd ../..
echo "clean all successful"
fi
if [[ -z "$2" ]]; then
cd "${COMPUTER_TYPE}"/catkin_ws
catkin clean -y
cd ../..
echo "clean ${COMPUTER_TYPE} successful"
fi
exit 0
fi
if [[ -z "$COMPUTER_TYPE" ]]; then
echo "COMPUTER_TYPE variable not defined, please set to workspace and rerun this script."
exit 1
fi
# shellcheck disable=SC1091
source /opt/ros/noetic/setup.bash
echo "Building core workspace"
cd core/catkin_ws
catkin build
# shellcheck disable=SC1091
source devel/setup.bash
cd ../..
echo "Building ${COMPUTER_TYPE} workspace"
cd "${COMPUTER_TYPE}"/catkin_ws
catkin build
# shellcheck disable=SC1091
source devel/setup.bash
cd ../..
echo "If you did not source this script, please run"
echo "source ${COMPUTER_TYPE}/catkin_ws/devel/setup.bash"