.
This commit is contained in:
parent
46978ae799
commit
ce56c6e105
53 changed files with 776 additions and 891 deletions
22
rules/fetch_file.bzl
Normal file
22
rules/fetch_file.bzl
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# TODO implement sha256sum attribute + checksum verification
|
||||
|
||||
def _fetch_file_impl(ctx):
|
||||
out_file = ctx.actions.declare_file(ctx.attr.filename)
|
||||
ctx.actions.run_shell(
|
||||
outputs = [out_file],
|
||||
command = "curl -Lso \"$1\" \"$2\"",
|
||||
arguments = [out_file.path, ctx.attr.url],
|
||||
execution_requirements = {
|
||||
"requires-network": "1",
|
||||
},
|
||||
progress_message = "Downloading plugin %s" % ctx.attr.filename,
|
||||
)
|
||||
return [DefaultInfo(files = depset([out_file]))]
|
||||
|
||||
fetch_file = rule(
|
||||
implementation = _fetch_file_impl,
|
||||
attrs = {
|
||||
"url": attr.string(mandatory = True),
|
||||
"filename": attr.string(mandatory = True),
|
||||
},
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue