-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.rs
40 lines (35 loc) · 928 Bytes
/
build.rs
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
31
32
33
34
35
36
37
38
39
40
use camino::Utf8Path;
use std::env;
use uniffi_bindgen::bindings::KotlinBindingGenerator;
use uniffi_bindgen::bindings::SwiftBindingGenerator;
fn main() {
let udl_file = Utf8Path::new("src/lipalightninglib.udl");
println!("cargo:rerun-if-changed={udl_file}");
uniffi_bindgen::generate_component_scaffolding(
udl_file,
Some(Utf8Path::new(&env::var("OUT_DIR").unwrap())),
false,
)
.unwrap();
uniffi_bindgen::generate_bindings(
udl_file,
None,
SwiftBindingGenerator,
Some(Utf8Path::new("bindings/swift")),
None,
None,
false,
)
.unwrap();
uniffi_bindgen::generate_bindings(
udl_file,
None,
KotlinBindingGenerator,
Some(Utf8Path::new("bindings/kotlin")),
None,
None,
false,
)
.unwrap();
println!("cargo:rerun-if-changed=.cargo/config.toml");
}