Files
codeql/rust/extractor/BUILD.bazel
Paolo Tranquilli 299fe2eb3f Rust: add proc-macro capabilities to QL tests
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.
2025-06-17 16:58:33 +02:00

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",
],
)