Created
March 31, 2017 13:23
-
-
Save kchodorow/01b8b9eebb757a43e18e113461102499 to your computer and use it in GitHub Desktop.
Skylark rule with output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load("//:output.bzl", "my_rule") | |
my_rule(name = "foo") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO: Found 1 target... | |
>>>>> # //:foo [action 'Generating b'] | |
(cd /home/kchodorow/.cache/bazel/_bazel_kchodorow/f454bcbe3fb58b7971b0951d116298e9/execroot/class-workspace && \ | |
exec env - \ | |
/bin/bash -c 'touch a; touch bazel-out/local-fastbuild/bin/b') | |
Target //:foo up-to-date: | |
bazel-bin/b | |
INFO: Elapsed time: 9.406s, Critical Path: 9.16s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _rule_impl(ctx): | |
ctx.action( | |
outputs = [ctx.outputs.b], | |
command = "touch a; touch %s" % ctx.outputs.b.path) | |
my_rule = rule( | |
implementation = _rule_impl, | |
outputs = {'b' : 'b'} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment