Preserve nested architecture during authoring and distinguish allocation summaries

This commit is contained in:
2026-09-05 17:58:46 +03:00
parent c20a2073d7
commit c7101b970a
13 changed files with 2719 additions and 1653 deletions
+23
View File
@@ -0,0 +1,23 @@
//! Regenerate both distributable forms from one model, preserving shared IDs.
use oa_core::{Project, persistence};
use std::path::PathBuf;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let directory = std::env::args_os()
.nth(1)
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from("examples"));
let project = Project::demo();
let source = directory.join("coastal-rescue.arcadia");
let json = directory.join("coastal-rescue.json");
persistence::save(&source, &project)?;
persistence::save(&json, &project)?;
assert_eq!(persistence::load(&source)?, project);
assert_eq!(persistence::load(&json)?, project);
println!(
"Wrote and verified {} and {}",
source.display(),
json.display()
);
Ok(())
}