blob: b24b3c2c30968223d62892a68453c8bdfbe90605 [file] [log] [blame]
Ray Milkey8705cce2019-01-14 14:05:48 -08001def _impl(ctx):
2 output = ctx.outputs.deps_files
3
4 dep_list = []
5 for dep in ctx.files.deps:
6 dep_list += [dep.path]
7
8 cmd = [
9 "echo %s >> %s" % (",".join(dep_list), output.path),
10 ]
11
Brett Bergquist7385b792021-01-20 08:30:15 -050012 ctx.actions.run_shell(
Ray Milkey8705cce2019-01-14 14:05:48 -080013 inputs = ctx.files.deps,
14 outputs = [output],
15 progress_message = "Generating deps file paths for %s" % ctx.attr.name,
16 command = ";\n".join(cmd),
17 )
18
19deps_files = rule(
20 attrs = {
21 "deps": attr.label_list(allow_files = True),
22 },
23 implementation = _impl,
24 outputs = {"deps_files": "%{name}-deps-files.txt"},
25)