mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Python: Copy Python extractor to codeql repo
This commit is contained in:
38
python/extractor/tsg-python/tree-sitter-python/BUILD.bazel
Normal file
38
python/extractor/tsg-python/tree-sitter-python/BUILD.bazel
Normal file
@@ -0,0 +1,38 @@
|
||||
load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
|
||||
load("@rules_rust//rust:defs.bzl", "rust_library")
|
||||
load("@tsg_python_crate_index//: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 = "tsg-build-script",
|
||||
srcs = ["bindings/rust/build.rs"],
|
||||
data = glob([
|
||||
"src/**",
|
||||
]),
|
||||
deps = all_crate_deps(
|
||||
build = True,
|
||||
),
|
||||
)
|
||||
|
||||
rust_library(
|
||||
name = "tree-sitter-python",
|
||||
srcs = [
|
||||
"bindings/rust/lib.rs",
|
||||
],
|
||||
aliases = aliases(),
|
||||
compile_data = glob([
|
||||
"src/**",
|
||||
"queries/**",
|
||||
]) + [
|
||||
"grammar.js",
|
||||
],
|
||||
proc_macro_deps = all_crate_deps(
|
||||
proc_macro = True,
|
||||
),
|
||||
deps = [":tsg-build-script"] + all_crate_deps(
|
||||
normal = True,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user