Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluate conditions in devel jobs #621

Merged
merged 1 commit into from
Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions scripts/devel/create_devel_task_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ def main(argv=sys.argv[1:]):
for workspace_root in args.workspace_root:
source_space = os.path.join(workspace_root, 'src')
print("Crawling for packages in workspace '%s'" % source_space)
pkgs.update(find_packages(source_space))
ws_pkgs = find_packages(source_space)
for pkg in ws_pkgs.values():
pkg.evaluate_conditions({
'ROS_DISTRO': args.rosdistro_name,
'ROS_VERSION': args.ros_version,
})
pkgs.update(ws_pkgs)

pkg_names = [pkg.name for pkg in pkgs.values()]
print("Found the following packages:")
Expand Down Expand Up @@ -191,7 +197,9 @@ def get_dependencies(pkgs, label, get_dependencies_callback):


def _get_build_and_recursive_run_dependencies(pkg, pkgs):
depends = pkg.build_depends + pkg.buildtool_depends
depends = [
d for d in pkg.build_depends + pkg.buildtool_depends
if d.evaluated_condition is not False]
# include recursive run dependencies on other pkgs in the workspace
# if pkg A in the workspace build depends on pkg B in the workspace
# then the recursive run dependencies of pkg B need to be installed
Expand All @@ -208,8 +216,11 @@ def _get_build_and_recursive_run_dependencies(pkg, pkgs):
run_depends_in_pkgs.remove(pkg_name)

# append run dependencies
run_depends = pkg.build_export_depends + \
pkg.buildtool_export_depends + pkg.exec_depends
run_depends = [
d for d in
pkg.build_export_depends + pkg.buildtool_export_depends +
pkg.exec_depends
if d.evaluated_condition is not False]
depends += run_depends

# consider recursive dependencies
Expand All @@ -220,8 +231,11 @@ def _get_build_and_recursive_run_dependencies(pkg, pkgs):


def _get_run_and_test_dependencies(pkg, pkgs):
return pkg.build_export_depends + pkg.buildtool_export_depends + \
return [
d for d in
pkg.build_export_depends + pkg.buildtool_export_depends +
pkg.exec_depends + pkg.test_depends
if d.evaluated_condition is not False]


def initialize_resolver(rosdistro_name, os_name, os_code_name):
Expand Down