Preserve nested architecture during authoring and distinguish allocation summaries
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
Reference in New Issue
Block a user