Rust: integrate rust code generation into //rust/codegen

This commit is contained in:
Paolo Tranquilli
2024-10-08 10:37:53 +02:00
parent 96dda8808c
commit 61c3aa6288
6 changed files with 148 additions and 318 deletions

13
rust/codegen/codegen.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -eu
source misc/bazel/runfiles.sh 2>/dev/null || source external/ql~/misc/bazel/runfiles.sh
ast_generator="$(rlocation "$1")"
ast_generator_manifest="$(rlocation "$2")"
codegen="$(rlocation "$3")"
codegen_conf="$(rlocation "$4")"
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
"$codegen" --configuration-file="$codegen_conf"