From 21ac5e34552da023f2135915fd4354a69eb0c213 Mon Sep 17 00:00:00 2001 From: Petr Gadorek Date: Thu, 30 Jan 2025 14:57:54 +0100 Subject: [PATCH] EIM-18 added possibility to install additional idf_tools features --- Cargo.lock | 2 +- src/cli_args/mod.rs | 11 +++++++++++ src/wizard/mod.rs | 14 +++++++++++++- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82b82db..e3f2fb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1169,7 +1169,7 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idf-im-lib" version = "0.1.12" -source = "git+https://github.com/espressif/idf-im-lib.git?branch=master#ee3046212081b5783c63621b9938555a396ca645" +source = "git+https://github.com/espressif/idf-im-lib.git?branch=master#638846528eadd353ad18d2ef45658df29fcc7b84" dependencies = [ "anyhow", "config", diff --git a/src/cli_args/mod.rs b/src/cli_args/mod.rs index 53300f7..f29cc88 100644 --- a/src/cli_args/mod.rs +++ b/src/cli_args/mod.rs @@ -128,6 +128,12 @@ pub struct Cli { help = "if set, the installer will as it's very last move save the configuration to the specified file path. This file can than be used to repeat the installation with the same settings." )] pub config_file_save_path: Option, + + #[arg( + long, + help = "Comma separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF." + )] + pub idf_features: Option, } impl IntoIterator for Cli { @@ -199,6 +205,11 @@ impl IntoIterator for Cli { "config_file_save_path".to_string(), self.config_file_save_path.map(Into::into), ), + ( + "idf_features".to_string(), + self.idf_features + .map(|s| s.split(',').collect::>().into()), + ), ] .into_iter() } diff --git a/src/wizard/mod.rs b/src/wizard/mod.rs index d685818..f0dce16 100644 --- a/src/wizard/mod.rs +++ b/src/wizard/mod.rs @@ -546,7 +546,19 @@ pub async fn run_wizzard_run(mut config: Settings) -> Result<(), String> { let idf_tools_path = get_and_validate_idf_tools_path(&mut config, &idf_path)?; - idf_im_lib::python_utils::run_idf_tools_py(idf_tools_path.to_str().unwrap(), &env_vars)?; + if config.idf_features.is_some() { + let features = config.idf_features.clone().unwrap(); + idf_im_lib::python_utils::run_idf_tools_py_with_features( + idf_tools_path.to_str().unwrap(), + &env_vars, + &features, + )?; + } else { + idf_im_lib::python_utils::run_idf_tools_py( + idf_tools_path.to_str().unwrap(), + &env_vars, + )?; + } let export_paths = idf_im_lib::idf_tools::get_tools_export_paths( tools,