blob: 5db80ee5b4601a442b29759add59f788821c4d3b [file] [log] [blame]
Tim Windelschmidt8e19fa42024-11-12 13:39:43 +00001def _build_logo_impl(ctx):
2 arguments = ctx.actions.args()
3
4 arguments.add_all(["--input"] + ctx.files.logo)
5 output = ctx.actions.declare_file("logo.asm")
6 arguments.add_all(["--output", output])
7
8 ctx.actions.run(
9 outputs = [output],
10 inputs = ctx.files.logo,
11 arguments = [arguments],
12 executable = ctx.executable._genlogo,
13 )
14
15 return DefaultInfo(
16 files = depset([output]),
17 )
18
Tim Windelschmidt8e19fa42024-11-12 13:39:43 +000019gen_logo = rule(
20 implementation = _build_logo_impl,
21 attrs = {
22 "logo": attr.label(
23 allow_single_file = True,
24 ),
25 "_genlogo": attr.label(
26 default = Label(":genlogo"),
27 allow_single_file = True,
28 executable = True,
29 cfg = "exec",
30 ),
31 },
32)