-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.rs
More file actions
30 lines (24 loc) · 1.02 KB
/
build.rs
File metadata and controls
30 lines (24 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use sails_rs::ClientGenerator;
use std::{env, path::PathBuf};
fn main() {
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap());
let client_rs_file_path = manifest_dir.join("src/rmrk_catalog.rs");
// #[cfg(not(target_family = "windows"))]
// let idl_file_path = PathBuf::from(env::var("OUT_DIR").unwrap()).join("rmrk-catalog.idl");
// #[cfg(not(target_family = "windows"))]
// git_download::repo("https://github.com/gear-tech/sails")
// .branch_name("master")
// .add_file(
// "examples/rmrk/catalog/wasm/rmrk-catalog.idl",
// &idl_file_path,
// )
// .exec()
// .unwrap();
// #[cfg(target_family = "windows")]
// let idl_file_path = manifest_dir.join("..\\..\\catalog\\wasm\\rmrk-catalog.idl");
let idl_file_path = manifest_dir.join("../../catalog/wasm/rmrk-catalog.idl");
ClientGenerator::from_idl_path(&idl_file_path)
.with_mocks("mockall")
.generate_to(client_rs_file_path)
.unwrap();
}