bootstrap/core/debuggers/android.rs
1use std::path::PathBuf;
2
3use crate::core::builder::Builder;
4use crate::core::config::TargetSelection;
5
6pub(crate) struct Android {
7 pub(crate) adb_path: &'static str,
8 pub(crate) adb_test_dir: &'static str,
9 pub(crate) android_cross_path: PathBuf,
10}
11
12pub(crate) fn discover_android(builder: &Builder<'_>, target: TargetSelection) -> Option<Android> {
13 let adb_path = "adb";
14 // See <https://github.com/rust-lang/rust/pull/102755>.
15 let adb_test_dir = "/data/local/tmp/work";
16
17 let android_cross_path = if target.contains("android") && !builder.config.dry_run() {
18 builder.cc(target).parent().unwrap().parent().unwrap().to_owned()
19 } else {
20 PathBuf::new()
21 };
22
23 Some(Android { adb_path, adb_test_dir, android_cross_path })
24}