Skip to content

Commit

Permalink
implement codegen foundations for snippet index
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 10, 2024
1 parent 41c24f0 commit 8431cfb
Show file tree
Hide file tree
Showing 11 changed files with 964 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6693,8 +6693,10 @@ dependencies = [
"re_log",
"re_tracing",
"rust-format",
"serde",
"syn 2.0.85",
"tempfile",
"toml",
"unindent",
"xshell",
]
Expand Down
2 changes: 2 additions & 0 deletions crates/build/re_types_builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ proc-macro2.workspace = true
quote.workspace = true
rayon.workspace = true
rust-format.workspace = true
serde = { workspace = true, features = ["derive"] }
syn.workspace = true
tempfile.workspace = true
toml = { workspace = true, features = ["parse", "preserve_order"] }
unindent.workspace = true
xshell.workspace = true

Expand Down
9 changes: 9 additions & 0 deletions crates/build/re_types_builder/src/bin/build_re_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const CPP_OUTPUT_DIR_PATH: &str = "rerun_cpp";
const PYTHON_OUTPUT_DIR_PATH: &str = "rerun_py/rerun_sdk/rerun";
const PYTHON_TESTING_OUTPUT_DIR_PATH: &str = "rerun_py/tests/test_types";
const DOCS_CONTENT_DIR_PATH: &str = "docs/content/reference/types";
const SNIPPETS_REF_DIR_PATH: &str = "docs/snippets/";

/// This uses [`rayon::scope`] to spawn all closures as tasks
/// running in parallel. It blocks until all tasks are done.
Expand Down Expand Up @@ -91,6 +92,7 @@ fn main() {
let python_output_dir_path = workspace_dir.join(PYTHON_OUTPUT_DIR_PATH);
let python_testing_output_dir_path = workspace_dir.join(PYTHON_TESTING_OUTPUT_DIR_PATH);
let docs_content_dir_path = workspace_dir.join(DOCS_CONTENT_DIR_PATH);
let snippets_ref_dir_path = workspace_dir.join(SNIPPETS_REF_DIR_PATH);

let cur_hash = read_versioning_hash(&re_types_source_hash_path);
re_log::debug!("cur_hash: {cur_hash:?}");
Expand Down Expand Up @@ -159,6 +161,13 @@ fn main() {
&arrow_registry,
check,
),
|| re_types_builder::generate_snippets_ref(
&reporter,
snippets_ref_dir_path,
&objects,
&arrow_registry,
check,
),
);

report.finalize();
Expand Down
3 changes: 2 additions & 1 deletion crates/build/re_types_builder/src/codegen/docs/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod arrow_datatype;
mod snippets_ref;
mod website;

pub use self::website::DocsCodeGenerator;
pub use self::{snippets_ref::SnippetsRefCodeGenerator, website::DocsCodeGenerator};
Loading

0 comments on commit 8431cfb

Please sign in to comment.