(
project_dir: &Path,
android: &AndroidToolchain,
release: bool,
)
| 1002 | } |
| 1003 | if args.iter().any(|a| a == "--console") { |
| 1004 | return Err("`--console` is not supported with `--target android`".to_string()); |
| 1005 | } |
| 1006 | |
| 1007 | let profile = args.iter().any(|a| a == "--profile"); |
| 1008 | let release = args.iter().any(|a| a == "--release"); |
| 1009 | let project_dir = parse_flag_value(args, "--path") |
| 1010 | .map(|p| resolve_local_path(&p, cwd)) |
| 1011 | .unwrap_or_else(|| cwd.to_path_buf()); |
| 1012 | let project_dir = project_dir.canonicalize().unwrap_or(project_dir); |
| 1013 | update_workspace_vscode_linked_projects(&workspace_root(), &project_dir)?; |
| 1014 | update_project_vscode_linked_projects(&project_dir)?; |
| 1015 | |
| 1016 | let android = prepare_android_toolchain()?; |
| 1017 | |
| 1018 | log_step("Building Android Dev Bundle"); |
| 1019 | compile_project_bundle( |
| 1020 | &project_dir, |
| 1021 | ProjectBuildOptions::new(profile, false) |
| 1022 | .with_target(ProjectBuildTarget::Android) |
| 1023 | .with_demo(args.iter().any(|a| a == "--demo")) |
| 1024 | .with_release(release) |
| 1025 | .with_android_sdk_root(Some(leak_string( |
| 1026 | android.sdk_root.to_string_lossy().to_string(), |
| 1027 | ))) |
| 1028 | .with_android_ndk_root(Some(leak_string( |
| 1029 | android.ndk_root.to_string_lossy().to_string(), |
| 1030 | ))), |
| 1031 | ) |
| 1032 | .map_err(|err| { |
| 1033 | format!( |
| 1034 | "android dev pipeline failed for {}: {err}", |
| 1035 | project_dir.display() |
| 1036 | ) |
| 1037 | })?; |
| 1038 | log_done("Android Dev Bundle Built"); |
| 1039 | |
| 1040 | log_note("Running Android App"); |
| 1041 | run_android_project(&project_dir, &android, release) |
| 1042 | } |
| 1043 | |
| 1044 | fn leak_string(value: String) -> &'static str { |
no test coverage detected