mirror of https://github.com/tauri-apps/tauri
chore(cli): remove `android open` and `ios open` commands (#10480)
It is recommended to use `[android|ios] dev --open` or `[android|ios] build --open` instead as it properly sets up the requirements for developing and building apps with Tauri.
This commit is contained in:
parent
e2dc76cfbf
commit
a3cd9779a4
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
"tauri-cli": patch:changes
|
||||
"@tauri-apps/cli": patch:changes
|
||||
---
|
||||
|
||||
Removed the `[android|ios] open` command. It is recommended to use `[android|ios] dev --open` or `[android|ios] build --open` instead.
|
|
@ -37,7 +37,6 @@ use crate::{helpers::config::Config as TauriConfig, Result};
|
|||
mod android_studio_script;
|
||||
mod build;
|
||||
mod dev;
|
||||
mod open;
|
||||
pub(crate) mod project;
|
||||
|
||||
#[derive(Parser)]
|
||||
|
@ -67,8 +66,6 @@ pub struct InitOptions {
|
|||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
Init(InitOptions),
|
||||
/// Open project in Android Studio
|
||||
Open,
|
||||
Dev(dev::Options),
|
||||
Build(build::Options),
|
||||
#[clap(hide(true))]
|
||||
|
@ -84,7 +81,6 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
|||
false,
|
||||
options.skip_targets_install,
|
||||
)?,
|
||||
Commands::Open => open::command()?,
|
||||
Commands::Dev(options) => dev::command(options, noise_level)?,
|
||||
Commands::Build(options) => build::command(options, noise_level)?,
|
||||
Commands::AndroidStudioScript(options) => android_studio_script::command(options)?,
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use super::{ensure_init, env, get_app, get_config, inject_assets, MobileTarget};
|
||||
use crate::{
|
||||
helpers::config::get as get_tauri_config,
|
||||
interface::{AppInterface, Interface},
|
||||
Result,
|
||||
};
|
||||
|
||||
use cargo_mobile2::os;
|
||||
|
||||
pub fn command() -> Result<()> {
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Android, None)?;
|
||||
|
||||
let (config, _metadata) = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
get_config(
|
||||
&get_app(tauri_config_, &AppInterface::new(tauri_config_, None)?),
|
||||
tauri_config_,
|
||||
None,
|
||||
&Default::default(),
|
||||
)
|
||||
};
|
||||
ensure_init(
|
||||
&tauri_config,
|
||||
config.app(),
|
||||
config.project_dir(),
|
||||
MobileTarget::Android,
|
||||
)?;
|
||||
inject_assets(&config, tauri_config.lock().unwrap().as_ref().unwrap())?;
|
||||
let env = env()?;
|
||||
os::open_file_with("Android Studio", config.project_dir(), &env.base).map_err(Into::into)
|
||||
}
|
|
@ -42,7 +42,6 @@ use std::{
|
|||
|
||||
mod build;
|
||||
mod dev;
|
||||
mod open;
|
||||
pub(crate) mod project;
|
||||
mod xcode_script;
|
||||
|
||||
|
@ -79,8 +78,6 @@ pub struct InitOptions {
|
|||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
Init(InitOptions),
|
||||
/// Open project in Xcode
|
||||
Open,
|
||||
Dev(dev::Options),
|
||||
Build(build::Options),
|
||||
#[clap(hide(true))]
|
||||
|
@ -96,7 +93,6 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> {
|
|||
options.reinstall_deps,
|
||||
options.skip_targets_install,
|
||||
)?,
|
||||
Commands::Open => open::command()?,
|
||||
Commands::Dev(options) => dev::command(options, noise_level)?,
|
||||
Commands::Build(options) => build::command(options, noise_level)?,
|
||||
Commands::XcodeScript(options) => xcode_script::command(options)?,
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
use super::{ensure_init, env, get_app, get_config, inject_assets, MobileTarget};
|
||||
use crate::{
|
||||
helpers::config::get as get_tauri_config,
|
||||
interface::{AppInterface, Interface},
|
||||
Result,
|
||||
};
|
||||
|
||||
use cargo_mobile2::os;
|
||||
|
||||
pub fn command() -> Result<()> {
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, None)?;
|
||||
|
||||
let (config, _metadata) = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
get_config(
|
||||
&get_app(tauri_config_, &AppInterface::new(tauri_config_, None)?),
|
||||
tauri_config_,
|
||||
None,
|
||||
&Default::default(),
|
||||
)
|
||||
};
|
||||
|
||||
ensure_init(
|
||||
&tauri_config,
|
||||
config.app(),
|
||||
config.project_dir(),
|
||||
MobileTarget::Ios,
|
||||
)?;
|
||||
inject_assets(&config)?;
|
||||
let env = env()?;
|
||||
os::open_file_with("Xcode", config.project_dir(), &env).map_err(Into::into)
|
||||
}
|
Loading…
Reference in New Issue