Skip to content

Commit

Permalink
feat: update for build script
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 16, 2023
1 parent 00888af commit 511076e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions counit-server/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
frameworks/libonnxruntime.*
libonnxruntime.*
public/*
2 changes: 2 additions & 0 deletions counit-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ serde_json = "1.0.104"
blake3 = "1.4.0"
uuid = { version = "1.4.0", features = ["v4", "fast-rng", "serde"] }

[build-dependencies]
fs_extra = "1.3.0"
10 changes: 9 additions & 1 deletion counit-server/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ fn copy(profile_dir: &Path) {
let dylib_path = profile_dir.join(dylib_name);
wait_for(&dylib_path);
println!("target: {target_path:?}, {:?}", env::current_dir());
fs::copy(dylib_path, target_path).unwrap();
fs::copy(dylib_path, &target_path).unwrap();

// copy model/* file to target_path
let model_path = Path::new(env!("CARGO_MANIFEST_DIR")).parent().unwrap().join("model");
let target = Path::new(".").join("public");
println!("model_path: {model_path:?}");
println!("target_path: {target:?}");

fs_extra::dir::copy(model_path, Path::new(".").join("public"), &fs_extra::dir::CopyOptions::new()).unwrap();
}

fn wait_for(dylib_path: &Path) {
Expand Down

0 comments on commit 511076e

Please sign in to comment.