Hilco Wijbenga
unread,Feb 24, 2021, 2:08:16 AM2/24/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bazel-discuss
Hi all,
I want to build a tool ("my_java_tool") and execute it to generate
code. I seem to be getting the syntax wrong.
def _my_java_tool_binary_impl(ctx):
<snip/>
ctx.actions.run(
<snip/>
executable = ctx.attr.the_executable_jar,
)
my_java_tool_binary = rule(
implementation = _my_java_tool_binary_impl,
attrs = {
"the_executable_jar": attr.label(
executable = True,
cfg = "exec",
allow_files = True,
default = "//my_java_tool:the_executable_jar",
),
},
)
This causes an error: got value of type 'Target', want 'File, string,
or FilesToRunProvider'.
Assuming I'm on the right track at all, what is the right syntax?
Cheers,
Hilco