| Tim Windelschmidt | 67f45f8 | 2025-07-29 21:45:00 +0200 | [diff] [blame^] | 1 | def _generate_analyzers_impl(ctx): |
| 2 | analyzers_file = ctx.actions.declare_file("analyzers.bzl") |
| 3 | |
| 4 | args = ctx.actions.args() |
| 5 | args.add("-out") |
| 6 | args.add(analyzers_file) |
| 7 | |
| 8 | ctx.actions.run( |
| 9 | outputs = [analyzers_file], |
| 10 | executable = ctx.executable._generate_analyzers, |
| 11 | arguments = [args], |
| 12 | ) |
| 13 | |
| 14 | return [DefaultInfo(files = depset([analyzers_file]), runfiles = ctx.runfiles(files = [analyzers_file]))] |
| 15 | |
| 16 | generate_analyzers = rule( |
| 17 | implementation = _generate_analyzers_impl, |
| 18 | attrs = { |
| 19 | "_generate_analyzers": attr.label( |
| 20 | default = ":generate_analyzers", |
| 21 | executable = True, |
| 22 | cfg = "exec", |
| 23 | ), |
| 24 | }, |
| 25 | ) |