-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrid_build.rs
executable file
·45 lines (40 loc) · 1.33 KB
/
rid_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
41
42
43
44
45
use rid_build::{
build, BuildConfig, BuildTarget, FlutterConfig, FlutterPlatform, Project,
};
use std::env;
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR")
.expect("Missing CARGO_MANIFEST_DIR, please run this via 'cargo run'");
let workspace_dir = &crate_dir;
let crate_name = &env::var("CARGO_PKG_NAME")
.expect("Missing CARGO_PKG_NAME, please run this via 'cargo run'");
let lib_name = &if cfg!(target_os = "windows") {
format!("{}", &crate_name)
} else {
format!("lib{}", &crate_name)
};
let build_config = BuildConfig {
target: BuildTarget::Debug,
project: Project::Flutter(FlutterConfig {
plugin_name: "plugin".to_string(),
platforms: vec![
// NOTE: Remove any of the below platforms that you don't support
// Mobile
//FlutterPlatform::ios(),
//FlutterPlatform::android(),
// Desktop
FlutterPlatform::macos(),
//FlutterPlatform::linux(),
<<<<<<< HEAD
FlutterPlatform::windows()
=======
>>>>>>> master
],
}),
lib_name,
crate_name,
project_root: &crate_dir,
workspace_root: Some(&workspace_dir),
};
build(&build_config).expect("Build failed");
}