mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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.
33 lines
692 B
Python
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__"],
|
|
)
|