mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
This adds the possibility to add a special `proc_macro.rs` source file to QL tests, which will be generated into a `proc_macro` crate the usual `lib` crate depends on. This allow to define procedural macros in QL tests, and is here used to move the `macro-expansion` integration test to be a language test instead. As the generated manifests involved were starting to get a bit complex, they are now generated from a `mustache` template.
23 lines
606 B
Python
23 lines
606 B
Python
load("//misc/bazel:rust.bzl", "codeql_rust_binary")
|
|
load("//misc/bazel/3rdparty/tree_sitter_extractors_deps:defs.bzl", "aliases", "all_crate_deps")
|
|
|
|
exports_files(["Cargo.toml"])
|
|
|
|
codeql_rust_binary(
|
|
name = "extractor",
|
|
srcs = glob(["src/**/*.rs"]),
|
|
aliases = aliases(),
|
|
compile_data = ["src/qltest_cargo.mustache"],
|
|
proc_macro_deps = all_crate_deps(
|
|
proc_macro = True,
|
|
) + [
|
|
"//rust/extractor/macros",
|
|
],
|
|
visibility = ["//rust:__subpackages__"],
|
|
deps = all_crate_deps(
|
|
normal = True,
|
|
) + [
|
|
"//shared/tree-sitter-extractor",
|
|
],
|
|
)
|