Created
June 17, 2016 14:33
-
-
Save kchodorow/22de1dcb8a3e929728d52f3aa8241ceb to your computer and use it in GitHub Desktop.
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("//:tester.bzl", "greet") | |
greet( | |
name = "a-greeting", | |
my_name = "kristina", | |
) |
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
$ bazel build :a-greeting | |
INFO: Found 1 target... | |
Target //:a-greeting up-to-date: | |
bazel-bin/hi-there-kristina | |
INFO: Elapsed time: 0.324s, Critical Path: 0.00s |
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 _impl(ctx): | |
output = ctx.outputs.greeting | |
ctx.file_action( | |
output = output, | |
content = "") | |
greet = rule( | |
attrs = {"my_name": attr.string()}, | |
outputs = {"greeting": "hi-there-%{my_name}"}, | |
implementation = _impl, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment