Skip to content

Commit debaf76

Browse files
authored
Add data support in ament_index_share_files (#418)
This patch adds correct runfiles propagation so that `data` attributes are correctly propagated through `ament_index`
1 parent 02bdb4e commit debaf76

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

bazel_ros2_rules/lib/ament_index.bzl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ def _ament_index_share_files_impl(ctx):
6565
}
6666

6767
for src in ctx.attr.srcs:
68-
# src is a target that could have multiple files
69-
for file in src.files.to_list():
68+
for file in depset(transitive = [
69+
src.files,
70+
src[DefaultInfo].default_runfiles.files,
71+
]).to_list():
7072
sp = file.short_path
7173
if sp.startswith(ctx.attr.strip_prefix):
7274
sp = sp[len(ctx.attr.strip_prefix):]
@@ -131,7 +133,8 @@ with the same package.
131133
132134
Args:
133135
package_name: name of a ROS 2 package to which these share files belong
134-
srcs: files to put into the share directory
136+
srcs: targets whose files are placed into the share directory. Both
137+
direct files and transitive runfiles are included.
135138
prefix: optional prefix to give to the generated runfiles.
136139
strip_prefix: optional prefix to strip from the short_path of the files
137140

0 commit comments

Comments
 (0)