18 lines
648 B
Rust
Raw Normal View History

2022-02-15 21:27:00 +08:00
use lib_infra::code_gen;
2022-02-16 10:00:31 +08:00
use lib_infra::code_gen::dart_event;
fn main() {
2022-02-15 21:27:00 +08:00
code_gen::protobuf_file::gen(env!("CARGO_PKG_NAME"), "./src/protobuf/proto");
2022-02-16 10:00:31 +08:00
#[cfg(feature = "flutter")]
copy_dart_event_files();
}
#[cfg(feature = "flutter")]
fn copy_dart_event_files() {
let workspace_dir = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap();
let flutter_sdk_path = std::env::var("FLUTTER_FLOWY_SDK_PATH").unwrap();
2022-02-16 11:13:02 +08:00
let output_file = format!("{}/{}/lib/dispatch/dart_event.dart", workspace_dir, flutter_sdk_path);
println!("cargo:rerun-if-changed={}", output_file);
2022-02-16 10:00:31 +08:00
dart_event::write_dart_event_file(&output_file);
}