Skip to content
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
9 changes: 6 additions & 3 deletions bazel_ros2_rules/lib/ament_index.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def _ament_index_share_files_impl(ctx):
}

for src in ctx.attr.srcs:
# src is a target that could have multiple files
for file in src.files.to_list():
for file in depset(transitive = [
src.files,
src[DefaultInfo].default_runfiles.files,
]).to_list():
sp = file.short_path
if sp.startswith(ctx.attr.strip_prefix):
sp = sp[len(ctx.attr.strip_prefix):]
Expand Down Expand Up @@ -131,7 +133,8 @@ with the same package.

Args:
package_name: name of a ROS 2 package to which these share files belong
srcs: files to put into the share directory
srcs: targets whose files are placed into the share directory. Both
direct files and transitive runfiles are included.
prefix: optional prefix to give to the generated runfiles.
strip_prefix: optional prefix to strip from the short_path of the files

Expand Down
Loading