forked from moveit/moveit2_tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_locally.sh
executable file
·63 lines (53 loc) · 1.55 KB
/
build_locally.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
#!/bin/bash -eu
export MOVEIT_BRANCH=main
export ROS_DISTRO=rolling
python_version=$(python --version 2>&1 | tr -d ' ' | tr '[:upper:]' '[:lower:]' | sed 's/\.[0-9]*$//')
# path variables required to build Python API documentation
export PYTHONPATH=/opt/ros/$ROS_DISTRO/lib/$python_version/site-packages:/opt/ros/$ROS_DISTRO/local/lib/$python_version/dist-packages
export LD_LIBRARY_PATH=/opt/ros/$ROS_DISTRO/lib
have_loop() {
for arg in "$@"; do
if [[ "${arg}" == "loop" ]]; then
return 0
fi
done
return 1
}
have_noinstall() {
for arg in "$@"; do
if [[ "${arg}" == "noinstall" ]]; then
return 0
fi
done
return 1
}
if [[ "$0" != "${BASH_SOURCE}" ]]; then
{
echo "This file is meant to be executed, not 'source'd:"
echo
echo " ./${BASH_SOURCE}"
} >&2
return 1
fi
################################################################################
# Begin Main Script
################################################################################
# Install dependencies, unless argument says to skip
if ! have_noinstall "$@"; then
sudo apt-get install -y doxygen graphviz
pip3 install --upgrade -r requirements.txt
fi
# A fresh build is required because changes to some components such as css files does not rebuilt currently
# See issue https://github.com/sphinx-doc/sphinx/issues/2090
# rm -rf build
# Build
make local-with-api
# Run
xdg-open ./build/html/index.html &
# Optional build loop
if have_loop "$@"; then
while inotifywait -re modify,move,create,delete .; do
rm -rf build
make html
done
fi