Skip to content

Commit

Permalink
chore: change tauri-mobile to cargo-mobile2 (#7953)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Oct 5, 2023
1 parent d735324 commit 1c9f3db
Show file tree
Hide file tree
Showing 17 changed files with 687 additions and 702 deletions.
1,291 changes: 638 additions & 653 deletions tooling/cli/Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ name = "cargo-tauri"
path = "src/main.rs"

[dependencies]
tauri-mobile = { version = "0.5.3", default-features = false }
cargo-mobile2 = { version = "0.6", default-features = false }
textwrap = { version = "0.11.0", features = [ "term_size" ] }
jsonrpsee = { version = "0.16", features = [ "server" ] }
jsonrpsee-core = "0.16"
Expand Down Expand Up @@ -106,15 +106,15 @@ libc = "0.2"
default = [ "rustls" ]
native-tls = [
"tauri-bundler/native-tls",
"tauri-mobile/native-tls",
"cargo-mobile2/native-tls",
"ureq/native-tls"
]
native-tls-vendored = [
"native-tls",
"tauri-bundler/native-tls-vendored",
"tauri-mobile/openssl-vendored"
"cargo-mobile2/openssl-vendored"
]
rustls = [ "tauri-bundler/rustls", "tauri-mobile/rustls", "ureq/tls" ]
rustls = [ "tauri-bundler/rustls", "cargo-mobile2/rustls", "ureq/tls" ]

[profile.release-size-optimized]
inherits = "release"
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/info/ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use colored::Colorize;
pub fn items() -> Vec<SectionItem> {
vec![SectionItem::new(
|| {
let teams = tauri_mobile::apple::teams::find_development_teams().unwrap_or_default();
let teams = cargo_mobile2::apple::teams::find_development_teams().unwrap_or_default();
Some((
if teams.is_empty() {
"Developer Teams: None".red().to_string()
Expand Down
22 changes: 11 additions & 11 deletions tooling/cli/src/mobile/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use clap::{Parser, Subcommand};
use std::{
env::set_var,
fs::{create_dir, create_dir_all, write},
process::exit,
thread::sleep,
time::Duration,
};
use sublime_fuzzy::best_match;
use tauri_mobile::{
use cargo_mobile2::{
android::{
adb,
config::{Config as AndroidConfig, Metadata as AndroidMetadata, Raw as RawAndroidConfig},
Expand All @@ -25,6 +16,15 @@ use tauri_mobile::{
os,
util::prompt,
};
use clap::{Parser, Subcommand};
use std::{
env::set_var,
fs::{create_dir, create_dir_all, write},
process::exit,
thread::sleep,
time::Duration,
};
use sublime_fuzzy::best_match;

use super::{
ensure_init, get_app,
Expand Down Expand Up @@ -159,7 +159,7 @@ pub fn get_config(

fn env() -> Result<Env> {
let env = super::env()?;
tauri_mobile::android::env::Env::from_env(env).map_err(Into::into)
cargo_mobile2::android::env::Env::from_env(env).map_err(Into::into)
}

fn delete_codegen_vars() {
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/android/android_studio_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::{detect_target_ok, ensure_init, env, get_app, get_config, read_option
use crate::{helpers::config::get as get_tauri_config, Result};
use clap::{ArgAction, Parser};

use tauri_mobile::{
use cargo_mobile2::{
android::target::Target,
opts::Profile,
target::{call_for_targets_with_fallback, TargetTrait},
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/android/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
use clap::{ArgAction, Parser};

use anyhow::Context;
use tauri_mobile::{
use cargo_mobile2::{
android::{aab, apk, config::Config as AndroidConfig, env::Env, target::Target},
opts::{NoiseLevel, Profile},
target::TargetTrait,
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/android/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
use clap::{ArgAction, Parser};

use anyhow::Context;
use tauri_mobile::{
use cargo_mobile2::{
android::{
config::{Config as AndroidConfig, Metadata as AndroidMetadata},
device::Device,
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/android/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use super::{ensure_init, env, get_app, get_config, inject_assets, MobileTarget};
use crate::{helpers::config::get as get_tauri_config, Result};

use tauri_mobile::os;
use cargo_mobile2::os;

pub fn command() -> Result<()> {
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Android, None)?;
Expand Down
6 changes: 3 additions & 3 deletions tooling/cli/src/mobile/android/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

use crate::{helpers::template, Result};
use anyhow::Context;
use handlebars::Handlebars;
use include_dir::{include_dir, Dir};
use tauri_mobile::{
use cargo_mobile2::{
android::{
config::{Config, Metadata},
target::Target,
Expand All @@ -20,6 +18,8 @@ use tauri_mobile::{
prefix_path,
},
};
use handlebars::Handlebars;
use include_dir::{include_dir, Dir};

use std::{
ffi::OsStr,
Expand Down
4 changes: 2 additions & 2 deletions tooling/cli/src/mobile/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
use super::{get_app, Target};
use crate::helpers::{config::get as get_tauri_config, template::JsonMap};
use crate::Result;
use handlebars::{Context, Handlebars, Helper, HelperResult, Output, RenderContext, RenderError};
use tauri_mobile::{
use cargo_mobile2::{
android::{
config::Config as AndroidConfig, env::Env as AndroidEnv, target::Target as AndroidTarget,
},
Expand All @@ -18,6 +17,7 @@ use tauri_mobile::{
cli::{Report, TextWrapper},
},
};
use handlebars::{Context, Handlebars, Helper, HelperResult, Output, RenderContext, RenderError};

use std::{
env::{current_dir, var, var_os},
Expand Down
6 changes: 3 additions & 3 deletions tooling/cli/src/mobile/ios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT

use clap::{Parser, Subcommand};
use sublime_fuzzy::best_match;
use tauri_mobile::{
use cargo_mobile2::{
apple::{
config::{
Config as AppleConfig, Metadata as AppleMetadata, Platform as ApplePlatform,
Expand All @@ -21,6 +19,8 @@ use tauri_mobile::{
os,
util::prompt,
};
use clap::{Parser, Subcommand};
use sublime_fuzzy::best_match;

use super::{
ensure_init, env, get_app,
Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/ios/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::{
use clap::{ArgAction, Parser};

use anyhow::Context;
use tauri_mobile::{
use cargo_mobile2::{
apple::{config::Config as AppleConfig, target::Target},
env::Env,
opts::{NoiseLevel, Profile},
Expand Down
4 changes: 2 additions & 2 deletions tooling/cli/src/mobile/ios/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ use crate::{
use clap::{ArgAction, Parser};

use anyhow::Context;
use dialoguer::{theme::ColorfulTheme, Select};
use tauri_mobile::{
use cargo_mobile2::{
apple::{config::Config as AppleConfig, device::Device, teams::find_development_teams},
config::app::App,
env::Env,
opts::{NoiseLevel, Profile},
};
use dialoguer::{theme::ColorfulTheme, Select};

use std::env::{set_current_dir, set_var, var_os};

Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/ios/open.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use super::{ensure_init, env, get_app, get_config, inject_assets, MobileTarget};
use crate::{helpers::config::get as get_tauri_config, Result};

use tauri_mobile::os;
use cargo_mobile2::os;

pub fn command() -> Result<()> {
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, None)?;
Expand Down
16 changes: 8 additions & 8 deletions tooling/cli/src/mobile/ios/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@

use crate::{helpers::template, Result};
use anyhow::Context;
use handlebars::Handlebars;
use include_dir::{include_dir, Dir};
use std::{
ffi::{OsStr, OsString},
fs::{create_dir_all, OpenOptions},
path::{Component, PathBuf},
};
use tauri_mobile::{
use cargo_mobile2::{
apple::{
config::{Config, Metadata},
deps, rust_version_check,
Expand All @@ -21,6 +14,13 @@ use tauri_mobile::{
target::TargetTrait as _,
util::{self, cli::TextWrapper},
};
use handlebars::Handlebars;
use include_dir::{include_dir, Dir};
use std::{
ffi::{OsStr, OsString},
fs::{create_dir_all, OpenOptions},
path::{Component, PathBuf},
};

const TEMPLATE_DIR: Dir<'_> = include_dir!("templates/mobile/ios");

Expand Down
2 changes: 1 addition & 1 deletion tooling/cli/src/mobile/ios/xcode_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use crate::{
Result,
};

use cargo_mobile2::{apple::target::Target, opts::Profile};
use clap::Parser;
use tauri_mobile::{apple::target::Target, opts::Profile};

use std::{
collections::HashMap,
Expand Down
16 changes: 8 additions & 8 deletions tooling/cli/src/mobile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ use jsonrpsee_client_transport::ws::WsTransportClientBuilder;
use jsonrpsee_core::rpc_params;
use serde::{Deserialize, Serialize};

use cargo_mobile2::{
config::app::{App, Raw as RawAppConfig},
env::Error as EnvError,
opts::{NoiseLevel, Profile},
ChildHandle,
};
use std::{
collections::HashMap,
env::{set_var, temp_dir},
Expand All @@ -33,18 +39,12 @@ use std::{
Arc,
},
};
use tauri_mobile::{
config::app::{App, Raw as RawAppConfig},
env::Error as EnvError,
opts::{NoiseLevel, Profile},
ChildHandle,
};
use tokio::runtime::Runtime;

#[cfg(not(windows))]
use tauri_mobile::env::Env;
use cargo_mobile2::env::Env;
#[cfg(windows)]
use tauri_mobile::os::Env;
use cargo_mobile2::os::Env;

pub mod android;
mod init;
Expand Down

0 comments on commit 1c9f3db

Please sign in to comment.