(args: &[String], cwd: &Path)
| 1110 | .with_fresh(args.iter().any(|a| a == "--fresh")) |
| 1111 | .with_android_sdk_root(Some(leak_string( |
| 1112 | android.sdk_root.to_string_lossy().to_string(), |
| 1113 | ))) |
| 1114 | .with_android_ndk_root(Some(leak_string( |
| 1115 | android.ndk_root.to_string_lossy().to_string(), |
| 1116 | ))), |
| 1117 | ) |
| 1118 | .map(|_| { |
| 1119 | log_done("Android Project Bundle Built"); |
| 1120 | }) |
| 1121 | .map_err(|err| { |
| 1122 | format!( |
| 1123 | "android project pipeline failed for {}: {err}", |
| 1124 | project_dir.display() |
| 1125 | ) |
| 1126 | }) |
| 1127 | } |
| 1128 | |
| 1129 | fn dev_android_command(args: &[String], cwd: &Path) -> Result<(), String> { |
| 1130 | if args.iter().any(|a| a == "--timings") { |
| 1131 | return Err( |
| 1132 | "`--timings` is not supported with `perro dev --target android` yet".to_string(), |
| 1133 | ); |
| 1134 | } |
| 1135 | if args.iter().any(|a| a == "--ui-profile") { |
| 1136 | return Err( |
| 1137 | "`--ui-profile` is not supported with `perro dev --target android` yet".to_string(), |
| 1138 | ); |
| 1139 | } |
| 1140 | if args.iter().any(|a| a == "--csv-profile") { |
| 1141 | return Err( |
| 1142 | "`--csv-profile` is not supported with `perro dev --target android` yet".to_string(), |
| 1143 | ); |
| 1144 | } |
| 1145 | if args.iter().any(|a| a == "--console") { |
| 1146 | return Err("`--console` is not supported with `--target android`".to_string()); |
| 1147 | } |
| 1148 | |
| 1149 | let profile = args.iter().any(|a| a == "--profile"); |
| 1150 | let release = args.iter().any(|a| a == "--release"); |
| 1151 | let project_dir = parse_flag_value(args, "--path") |
| 1152 | .map(|p| resolve_local_path(&p, cwd)) |
| 1153 | .unwrap_or_else(|| cwd.to_path_buf()); |
| 1154 | let project_dir = project_dir.canonicalize().unwrap_or(project_dir); |
| 1155 | update_workspace_vscode_linked_projects(&workspace_root(), &project_dir)?; |
| 1156 | update_project_vscode_linked_projects(&project_dir)?; |
| 1157 | |
| 1158 | let android = prepare_android_toolchain()?; |
| 1159 | |
| 1160 | log_step("Building Android Dev Bundle"); |
| 1161 | compile_project_bundle( |
| 1162 | &project_dir, |
| 1163 | ProjectBuildOptions::new(profile, false) |
| 1164 | .with_target(ProjectBuildTarget::Android) |
| 1165 | .with_demo(args.iter().any(|a| a == "--demo")) |
| 1166 | .with_release(release) |
| 1167 | .with_android_sdk_root(Some(leak_string( |
| 1168 | android.sdk_root.to_string_lossy().to_string(), |
| 1169 | ))) |
no test coverage detected