From 77d74c09fb1d8f995b7e7846eeb7632270bf9c0d Mon Sep 17 00:00:00 2001 From: Stuart Axelbrooke Date: Sat, 19 Jul 2025 16:02:57 -0700 Subject: [PATCH] Generate stuff to make intellij happy --- .gitignore | 2 ++ README.md | 11 +++++++++++ generated_number/pippin | 1 - .../generate_cargo_toml.py | 0 scripts/generate_proto_for_ide.sh | 17 +++++++++++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) delete mode 100644 generated_number/pippin rename {tools/build_rules => scripts}/generate_cargo_toml.py (100%) create mode 100755 scripts/generate_proto_for_ide.sh diff --git a/.gitignore b/.gitignore index a06ef4e..a8d0ad1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ examples/podcast_reviews/data node_modules **/node_modules Cargo.toml +Cargo.lock +databuild/databuild.rs diff --git a/README.md b/README.md index f47149a..c49fed3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,17 @@ See the [podcast example BUILD file](examples/podcast_reviews/BUILD.bazel). ## Development +### Intellij + +Run these to allow intellij to understand the rust source: + +```bash +# Generate a Cargo.toml file so intellij can link rust src +python3 scripts/generate_cargo_toml.py +# Generate a gitignore'd rust file representing the protobuf interfaces +scripts/generate_proto_for_ide.sh +``` + ### Testing DataBuild core testing: diff --git a/generated_number/pippin b/generated_number/pippin deleted file mode 100644 index 3e932fe..0000000 --- a/generated_number/pippin +++ /dev/null @@ -1 +0,0 @@ -34 \ No newline at end of file diff --git a/tools/build_rules/generate_cargo_toml.py b/scripts/generate_cargo_toml.py similarity index 100% rename from tools/build_rules/generate_cargo_toml.py rename to scripts/generate_cargo_toml.py diff --git a/scripts/generate_proto_for_ide.sh b/scripts/generate_proto_for_ide.sh new file mode 100755 index 0000000..e3999d2 --- /dev/null +++ b/scripts/generate_proto_for_ide.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Generate protobuf files for IDE support + +set -e + +echo "Generating protobuf files for IDE..." + +# Build all proto targets to generate the .rs files +bazel build //databuild:generate_databuild_rust + +# Create a directory for IDE proto files +mkdir -p generated_proto + +# Copy generated files to a stable location +cp -f bazel-bin/databuild/databuild.rs databuild/ + +echo "Generated proto files copied to databuild/"