From 91d7c320857cc21b488f5a24277c68b8877c4187 Mon Sep 17 00:00:00 2001 From: Antonius Naumann Date: Sat, 7 Oct 2023 14:11:01 +0200 Subject: [PATCH] Move console UI related modules to console parent module --- src/commands/init.rs | 4 +--- src/commands/package.rs | 11 ++++------- src/{ => console}/command.rs | 0 src/{ => console}/config.rs | 0 src/{ => console}/error.rs | 0 src/console/messages.rs | 0 src/{ => console}/spinners.rs | 2 +- src/{ => console}/step.rs | 5 +++-- src/lib.rs | 25 +++++++++++++++++-------- 9 files changed, 26 insertions(+), 21 deletions(-) rename src/{ => console}/command.rs (100%) rename src/{ => console}/config.rs (100%) rename src/{ => console}/error.rs (100%) create mode 100644 src/console/messages.rs rename src/{ => console}/spinners.rs (99%) rename src/{ => console}/step.rs (92%) diff --git a/src/commands/init.rs b/src/commands/init.rs index a927610..64c401e 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -5,10 +5,8 @@ use std::process::Stdio; use clap::ValueEnum; use execute::{command, Execute}; -use crate::config::Config; -use crate::error::Result; +use crate::console::{run_step, Config, Result}; use crate::lib_type::LibType; -use crate::step::run_step; #[derive(ValueEnum, Debug, Clone)] #[value()] diff --git a/src/commands/package.rs b/src/commands/package.rs index 5ef0eba..400740b 100644 --- a/src/commands/package.rs +++ b/src/commands/package.rs @@ -14,14 +14,12 @@ use execute::{command, Execute}; use indicatif::MultiProgress; use crate::bindings::generate_bindings; -use crate::error::*; +use crate::console::*; +use crate::console::{run_step, run_step_with_commands}; use crate::lib_type::LibType; -use crate::spinners::*; -use crate::step::{run_step, run_step_with_commands}; use crate::swiftpackage::{create_swiftpackage, recreate_output_dir}; use crate::targets::*; use crate::xcframework::create_xcframework; -use crate::*; #[derive(ValueEnum, Debug, Clone)] #[value()] @@ -262,9 +260,8 @@ fn pick_lib_type(options: &[LibType], suggested: Option) -> Result(config: &Config, title: S, execute: E) -> Result where diff --git a/src/lib.rs b/src/lib.rs index 9eb0d92..24aaf21 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,25 +1,34 @@ #![allow(clippy::useless_format)] -mod command; mod commands { pub mod init; pub mod package; } +pub(crate) mod console { + mod command; + pub mod config; + pub mod error; + pub mod messages; + pub mod spinners; + pub mod step; + + pub use command::*; + pub use config::*; + pub use error::*; + pub use messages::*; + pub use spinners::*; + pub use step::*; +} mod bindings; -mod config; -mod error; mod lib_type; -mod spinners; -mod step; mod swiftpackage; mod targets; mod xcframework; -pub use command::*; pub use commands::*; -pub use config::*; -pub use error::*; +pub use console::error::Result; +pub use console::Config; pub use lib_type::LibType; pub use targets::*;