Skip to content

Commit fccf96f

Browse files
Build all python pkgs to show source code (#14)
Build all python pkgs to show source code
2 parents 9fd120f + 4b262f7 commit fccf96f

File tree

3 files changed

+55
-39
lines changed

3 files changed

+55
-39
lines changed

.ci/get_install_build_packages.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /usr/bin/env python3
2+
3+
import os
4+
import sys
5+
import catkin_pkg.package
6+
7+
8+
if len(sys.argv) >= 2:
9+
skip_pkgs = set(sys.argv[1:])
10+
else:
11+
skip_pkgs = set()
12+
13+
system_dir = os.getenv("TUE_SYSTEM_DIR")
14+
packages = (f.path for f in os.scandir(os.path.join(system_dir, "src")) if f.is_dir())
15+
16+
install_build_pkgs = set()
17+
build_pkgs = set()
18+
19+
for pkg_path in packages:
20+
pkg = os.path.split(pkg_path)[-1]
21+
for msg_type in ["action", "msg", "srv"]:
22+
if os.path.isdir(os.path.join(pkg_path, msg_type)):
23+
install_build_pkgs.add(pkg)
24+
break
25+
26+
if os.path.isfile(os.path.join(pkg_path, "setup.py")):
27+
catkin_package = catkin_pkg.package.parse_package(
28+
os.path.join(pkg_path, catkin_pkg.package.PACKAGE_MANIFEST_FILENAME)
29+
)
30+
for dep in catkin_package.build_depends:
31+
if "cpp" in dep.name: # Might be replaced by a better check to determine their is cpp code in this pkg
32+
install_build_pkgs.add(pkg)
33+
break
34+
else:
35+
build_pkgs.add(pkg)
36+
37+
print(
38+
"INSTALL_BUILD_PKGS=({}); BUILD_PKGS=({})".format(
39+
" ".join(install_build_pkgs.difference(skip_pkgs)), " ".join(build_pkgs.difference(skip_pkgs))
40+
)
41+
)

.ci/get_message_packages.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

.ci/install.bash

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,26 @@ then
8181
fi
8282

8383
echo -e "\e[35m\e[1m tue-get install tue-documentation-github --no-ros-deps --doc-depend\e[0m"
84-
docker exec -t tue-env bash -c 'source ~/.bashrc; tue-get install tue-documentation-github --no-ros-deps --doc-depend'
84+
docker exec tue-env bash -c 'source ~/.bashrc; tue-get install tue-documentation-github --no-ros-deps --doc-depend'
8585

8686
DOCKER_HOME=$(docker exec -t tue-env bash -c 'source ~/.bashrc; echo "$HOME"' | tr -d '\r')
8787

88-
echo -e "\e[35m\e[1m docker cp ${BASEDIR}/get_message_packages.py tue-env:${DOCKER_HOME}\e[0m"
89-
docker cp "${BASEDIR}"/get_message_packages.py tue-env:"${DOCKER_HOME}"
88+
echo -e "\e[35m\e[1m docker cp ${BASEDIR}/get_install_build_packages.py tue-env:${DOCKER_HOME}\e[0m"
89+
docker cp "${BASEDIR}"/get_install_build_packages.py tue-env:"${DOCKER_HOME}"
9090

9191
echo -e "\e[35m\e[1m ~/get_message_packages.py base_local_planner costmap_2d\e[0m"
92-
MSG_PKGS=($(docker exec -t tue-env bash -c 'source ~/.bashrc; ${HOME}/get_message_packages.py base_local_planner costmap_2d' | tr -d '\r')) # Skip base_local_planner and costmap_2d as these take too much time
93-
MSG_TARGETS=(${MSG_PKGS[@]/#/ros-})
94-
echo -e "\e[35m\e[1m MSG_PKGS= " "${MSG_PKGS[@]}" "\e[0m"
92+
eval "$(docker exec -t tue-env bash -c 'source ~/.bashrc; ${HOME}/get_install_build_packages.py base_local_planner costmap_2d' | tr -d '\r')" # Skip base_local_planner and costmap_2d as these take too much time
93+
INSTALL_BUILD_TARGETS=(${INSTALL_BUILD_PKGS[@]/#/ros-})
94+
echo -e "\e[35m\e[1m INSTALL_BUILD_PKGS=" "${INSTALL_BUILD_PKGS[*]}" "\e[0m"
95+
echo -e "\e[35m\e[1m BUILD_PKGS=" "${BUILD_PKGS[*]}" "\e[0m"
9596

96-
echo -e "\e[35m\e[1m tue-get install ros-python_orocos_kdl " "${MSG_TARGETS[@]}" "\e[0m"
97+
echo -e "\e[35m\e[1m tue-get install ros-python_orocos_kdl" "${INSTALL_BUILD_TARGETS[*]}" "\e[0m"
9798
# shellcheck disable=SC2145
98-
docker exec -t tue-env bash -c "source ~/.bashrc; tue-get install ros-python_orocos_kdl ${MSG_TARGETS[@]}" # Needs to be installed fully as it needs to be build to generate docs
99+
docker exec tue-env bash -c "source ~/.bashrc; tue-get install ros-python_orocos_kdl ${INSTALL_BUILD_TARGETS[*]}" # Needs to be installed fully as it needs to be build to generate docs
99100

100-
echo -e "\e[35m\e[1m tue-make --no-status python_orocos_kdl " "${MSG_PKGS[@]}" "\e[0m"
101+
echo -e '\e[35m\e[1m catkin config --workspace $TUE_SYSTEM_DIR --blacklist ed \e[0m'
102+
docker exec -t tue-env bash -c 'source ~/.bashrc; catkin config --workspace $TUE_SYSTEM_DIR --blacklist ed' # It is an exec-depend of ed_object_models, but we don't need to build it
103+
104+
echo -e "\e[35m\e[1m tue-make --no-status python_orocos_kdl" "${INSTALL_BUILD_PKGS[*]}" "${BUILD_PKGS[*]}" "\e[0m"
101105
# shellcheck disable=SC2145
102-
docker exec -t tue-env bash -c "source ~/.bashrc; tue-make --no-status python_orocos_kdl ${MSG_PKGS[@]}" # Needs to be build to generate docs
106+
docker exec -t tue-env bash -c "source ~/.bashrc; tue-make --no-status python_orocos_kdl ${INSTALL_BUILD_PKGS[*]} ${BUILD_PKGS[*]}" # Needs to be build to generate docs

0 commit comments

Comments
 (0)