CLI self-updater, warn on version mismatch, direct install.sh option, androidmanifest and info.plist customization, bump to 0.7-alpha.0 (#4095)
* wip.... bun installer * - warn on incompatible versions - clean up some logs - add coloring to log levels * add toasts to desktop/mobile * Auto open simulators * auto boot android * preserve url * pull out some of the warnings * add self-updater * wip: mcp * add install.sh and adjust binstall path * add some cuter styling to logs! * update "input.css" * update other input.css * style a bit more * change getting started * add windows installer * move dioxus-mobile into dioxus-desktop add sentry wip to cli * shorten timeout of toast * fix cli display * wire up customization of android manifest * udid is a real word * add 429 to lychee cache * accept all 200-204 and 429
This commit is contained in:
1 parent
53ef78823d
commit
4d3d55a7a3
56 files changed
+1560
-548
No files matched your search
@@ -11,6 +11,7 @@ use tokio::process::Command;
|
||||
/// https://gist.github.com/Pulimet/5013acf2cd5b28e55036c82c91bd56d8?permalink_comment_id=3678614
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct AndroidTools {
|
||||
pub(crate) sdk: Option<PathBuf>,
|
||||
pub(crate) ndk: PathBuf,
|
||||
pub(crate) adb: PathBuf,
|
||||
pub(crate) java_home: Option<PathBuf>,
|
||||
@@ -114,6 +115,7 @@ pub fn get_android_tools() -> Option<Arc<AndroidTools>> {
|
||||
ndk,
|
||||
adb,
|
||||
java_home,
|
||||
sdk,
|
||||
}))
|
||||
}
|
||||
|
||||
@@ -168,6 +170,18 @@ impl AndroidTools {
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) fn sdk(&self) -> PathBuf {
|
||||
// /Users/jonathankelley/Library/Android/sdk/ndk/25.2/... (25.2 is the ndk here)
|
||||
// /Users/jonathankelley/Library/Android/sdk/
|
||||
self.sdk
|
||||
.clone()
|
||||
.unwrap_or_else(|| self.ndk.parent().unwrap().parent().unwrap().to_path_buf())
|
||||
}
|
||||
|
||||
pub(crate) fn emulator(&self) -> PathBuf {
|
||||
self.sdk().join("emulator").join("emulator")
|
||||
}
|
||||
|
||||
// todo(jon): this should be configurable
|
||||
pub(crate) fn min_sdk_version(&self) -> u32 {
|
||||
24
|
||||
@@ -230,8 +244,11 @@ impl AndroidTools {
|
||||
"x86_64" => {
|
||||
triple.architecture = Architecture::X86_64;
|
||||
}
|
||||
"" => {
|
||||
tracing::debug!("No device running - probably waiting for emulator");
|
||||
}
|
||||
other => {
|
||||
tracing::warn!("Unknown architecture from adb: {other}");
|
||||
tracing::debug!("Unknown architecture from adb: {other}");
|
||||
}
|
||||
},
|
||||
Ok(Err(err)) => {
|
||||
@@ -248,10 +265,9 @@ impl AndroidTools {
|
||||
|
||||
fn var_or_debug(name: &str) -> Option<PathBuf> {
|
||||
use std::env::var;
|
||||
use tracing::debug;
|
||||
|
||||
var(name)
|
||||
.inspect_err(|_| debug!("{name} not set"))
|
||||
.inspect_err(|_| tracing::trace!("{name} not set"))
|
||||
.ok()
|
||||
.map(PathBuf::from)
|
||||
}
|
||||
Reference in new issue
Block a user