blob: 24c65ca048cea5d5f49895c66fea754026f23fc4 [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
12 ctx.action(
13 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)