Files
codeql/rust/codegen/BUILD.bazel
Paolo Tranquilli 8e31abaefe Rust: fix codegen to allow --force
This passes command line arguments to codegen, allowing in particular
`--force` to be passed.

Also, a convenience `//rust/codegen:py` is added to only run the python
based code generation, which will be faster and enough when
`ast-generator` is unchanged.
2024-10-15 14:37:30 +02:00

33 lines
692 B
Python

load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
_args = [
"//rust/ast-generator",
"//rust/ast-generator:manifest",
"//misc/codegen",
"//rust:codegen-conf",
]
sh_binary(
name = "codegen",
srcs = ["codegen.sh"],
args = ["$(rlocationpath %s)" % a for a in _args],
data = _args,
visibility = ["//rust:__subpackages__"],
deps = [
"//misc/bazel:sh_runfiles",
],
)
native_binary(
name = "py",
src = "//misc/codegen",
out = "codegen",
args = [
"--configuration-file=$(location //rust:codegen-conf)",
],
data = [
"//rust:codegen-conf",
],
visibility = ["//rust:__subpackages__"],
)