mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
* The ungram file is now taken from the rust-analyzer dependencies pulled in by bazel * the grammar parsing code is not published, so it must be taken directly from rust-analyzer code. That part should be less prone to be updated than the ungram file, so it does not necessarily need to be in sync with the rust-analyzer version is used elsewhere. * both need some patches. The former is patched during build, the latter during loading in `MODULE.bazel`.
35 lines
784 B
Python
35 lines
784 B
Python
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
|
|
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
|
|
|
|
_args = [
|
|
"//rust/ast-generator",
|
|
"//rust/ast-generator:ungram",
|
|
"//rust/ast-generator:Cargo.toml",
|
|
"//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__"],
|
|
)
|