Skip to content

Commit 89ddefe

Browse files
committed
bazel: genrule() demo of netlistsvg tool
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent ad09584 commit 89ddefe

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,3 +488,18 @@ netlistsvg(
488488
src = "alu.json",
489489
out = "alu.svg",
490490
)
491+
492+
# Demonstrate how to use this tool from a genrule
493+
#
494+
# https://docs.aspect.build/guides/rules_js_migration/#account-for-change-to-working-directory
495+
genrule(
496+
name = "alu_svg_2",
497+
srcs = ["alu.json"],
498+
outs = ["alu2.svg"],
499+
cmd = """
500+
BAZEL_BINDIR=$(BINDIR) $(location :netlistsvg) \
501+
../../../$(location alu.json) \
502+
-o ../../../$(location alu2.svg)
503+
""",
504+
tools = [":netlistsvg"],
505+
)

0 commit comments

Comments
 (0)