This commit is contained in:
kento2 2026-08-19 02:15:15 +02:00
parent 46978ae799
commit ce56c6e105
53 changed files with 776 additions and 891 deletions

22
rules/fetch_file.bzl Normal file
View 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),
},
)