-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb1c915
commit 647d530
Showing
20 changed files
with
5,847 additions
and
1,248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std::env; | ||
use std::fs; | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let project_dir = env::var_os("CARGO_MANIFEST_DIR").unwrap(); | ||
|
||
let sim_const_file_name = "sim_const.rs"; | ||
let sim_api_file_name = "sim_api.rs"; | ||
let sim_ik_api_file_name = "sim_ik_api.rs"; | ||
|
||
let sim_dir = Path::new(&project_dir) | ||
.join("src") | ||
.join("remote_api_objects") | ||
.join("sim"); | ||
|
||
let assets = Path::new(&project_dir).join("c_transpiler").join("assets"); | ||
|
||
let files = [sim_ik_api_file_name, sim_const_file_name, sim_api_file_name]; | ||
|
||
for file in files { | ||
let origin = assets.join(file); | ||
let dest = sim_dir.join(file); | ||
|
||
let content = | ||
fs::read_to_string(origin.clone()).unwrap_or_else(|_| panic!("read: {origin:?}")); | ||
|
||
fs::write(dest.clone(), content).unwrap_or_else(|_| panic!("write: {dest:?}")); | ||
} | ||
|
||
println!("cargo:rerun-if-changed=build.rs"); | ||
} |
Oops, something went wrong.