Skip to content

Commit

Permalink
better approach to file output for group.bzl rule (bazelbuild#311)
Browse files Browse the repository at this point in the history
This change mirrors what has already been done for passwd.bzl rule in
commit 0d6b0a3.
  • Loading branch information
pawelz authored and mattmoor committed Feb 7, 2018
1 parent 0d6b0a3 commit b7061c0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions contrib/group.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ def _group_file_impl(ctx):
entry[GroupFileContentProvider].gid,
",".join(entry[GroupFileContentProvider].users))
for entry in ctx.attr.entries])
ctx.file_action(
output = ctx.outputs.out,
content = f,
executable=False,
)
group_file = ctx.actions.declare_file(ctx.label.name)
ctx.actions.write(output=group_file, content=f)
return DefaultInfo(files=depset([group_file]))

group_entry = rule(
attrs = {
Expand All @@ -56,8 +54,5 @@ group_file = rule(
),
},
executable = False,
outputs = {
"out": "%{name}",
},
implementation = _group_file_impl,
)

0 comments on commit b7061c0

Please sign in to comment.