Files
codeql/unified/extractor/tree-sitter-swift/BUILD.bazel
Taus c5ae315dbe unified: auto-generate parser files
Uses the `tree-sitter-generate` crate to generate these files on the
fly.
2026-05-12 11:24:35 +00:00

43 lines
1014 B
Python

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load("@rules_rust//rust:defs.bzl", "rust_library")
load("//misc/bazel/3rdparty/tree_sitter_extractors_deps:defs.bzl", "aliases", "all_crate_deps")
package(default_visibility = ["//visibility:public"])
# This will run the build script from the root of the workspace, and
# collect the outputs.
cargo_build_script(
name = "tree-sitter-swift-build",
srcs = ["bindings/rust/build.rs"],
data = glob([
"src/scanner.c",
]) + [
"grammar.js",
],
deps = all_crate_deps(
build = True,
),
)
rust_library(
name = "tree-sitter-swift",
srcs = [
"bindings/rust/lib.rs",
],
aliases = aliases(),
compile_data = glob([
"src/**",
"queries/**",
]) + [
"grammar.js",
],
proc_macro_deps = all_crate_deps(
proc_macro = True,
),
deps = [":tree-sitter-swift-build"] + all_crate_deps(
normal = True,
),
)
exports_files(["Cargo.toml"])