Rust: bazel packaging

This commit is contained in:
Paolo Tranquilli
2024-08-30 13:05:46 +02:00
parent 3da6cee6ef
commit 4f0fe1ce3a
28 changed files with 207 additions and 28 deletions

9
rust/tools/BUILD.bazel Normal file
View File

@@ -0,0 +1,9 @@
load("//misc/bazel:pkg.bzl", "codeql_pkg_files")
codeql_pkg_files(
name = "tools",
exes = [
"index.sh",
],
visibility = ["//rust:__pkg__"],
)

17
rust/tools/index.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# TODO move this to rust code
inputs=($(find -name Cargo.toml))
if [ "${#inputs}" -eq 0 ]; then
inputs=($(find -name rust-project.json))
if [ "${#inputs}" -eq 0 ]; then
inputs=($(find -name '*.rs'))
if [ "${#inputs}" -eq 0 ]; then
echo "no source files found" >&2
exit 1
fi
fi
fi
exec "$CODEQL_EXTRACTOR_RUST_ROOT/tools/$CODEQL_PLATFORM/extractor" "${inputs[@]}"