From a278ef1e41f68fd0d1872f7727c836d98a778039 Mon Sep 17 00:00:00 2001 From: Samuel Marks <807580+SamuelMarks@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:40:35 -0500 Subject: [PATCH] [src/lib/{mod,time_summary}.rs] Make `time_summary` `pub`lic ; [src/lib/runner.rs] Make `run_protected_flow` public ; [Cargo.toml] Use official `git_info` and `rust_info` now that my PRs have been merged ; --- Cargo.lock | 10 ++++++---- Cargo.toml | 9 ++------- src/lib/cli.rs | 2 -- src/lib/mod.rs | 2 +- src/lib/runner.rs | 2 +- src/lib/time_summary.rs | 8 ++++---- 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3e6fc08..86320abc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -713,8 +713,9 @@ dependencies = [ [[package]] name = "git_info" -version = "0.1.2" -source = "git+https://github.com/SamuelMarks/git_info?branch=serde#6538c9d12b83c2a2ca9f6b5285f1c3bfb002b572" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9525474359e360de19580a77590f3491c94d57b1ef2b8bd468877a83cbc7f4cb" dependencies = [ "serde", ] @@ -1359,8 +1360,9 @@ dependencies = [ [[package]] name = "rust_info" -version = "0.3.2" -source = "git+https://github.com/SamuelMarks/rust_info?branch=serde#62a8e08a0b848f27d67748b268f9e83779734ed1" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99a6143e57e2d16a1dc652aa61664e8a1044d88e4b62470bde0a759800895c8d" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 25f3085f..27414dd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,9 +57,7 @@ duckscriptsdk = { version = "^0.9.3", default-features = false } envmnt = "^0.10.4" fern = "^0.6" fsio = { version = "^0.4", features = ["temp-path"] } -git_info = { git = "https://github.com/SamuelMarks/git_info", branch = "serde", features = [ - "serde", -] } +git_info = { version = "0.1.3", features = ["serde"] } glob = "^0.3.1" home = "^0.5" ignore = "^0.4" @@ -71,10 +69,7 @@ once_cell = "^1.19.0" petgraph = "^0.6.5" regex = "^1.10" run_script = "^0.10" -# rust_info = "^0.3.1" -rust_info = { git = "https://github.com/SamuelMarks/rust_info", branch = "serde", features = [ - "serde", -] } +rust_info = { version = "0.3.3", features = ["serde"] } semver = "^1" serde = "^1" serde_derive = "^1" diff --git a/src/lib/cli.rs b/src/lib/cli.rs index fc478c52..714961ee 100644 --- a/src/lib/cli.rs +++ b/src/lib/cli.rs @@ -141,8 +141,6 @@ pub fn run( let (env_info, config, task, time_summary_vec, start_time) = prepare_for_execution_plan(cli_args, global_config, logger_options)?; - // let execution_plan: ExecutionPlan; - if cli_args.list_all_steps || cli_args.list_category_steps.is_some() { cli_commands::list_steps::run( &config, diff --git a/src/lib/mod.rs b/src/lib/mod.rs index f013cada..12b24c28 100755 --- a/src/lib/mod.rs +++ b/src/lib/mod.rs @@ -74,7 +74,7 @@ mod recursion_level; pub mod runner; mod scriptengine; mod storage; -mod time_summary; +pub mod time_summary; mod toolchain; mod version; diff --git a/src/lib/runner.rs b/src/lib/runner.rs index d0edce76..6763aa93 100755 --- a/src/lib/runner.rs +++ b/src/lib/runner.rs @@ -636,7 +636,7 @@ fn prepare_protected_execution_plan(flow_info: &FlowInfo) -> Result>, execution_plan: &ExecutionPlan, diff --git a/src/lib/time_summary.rs b/src/lib/time_summary.rs index a63f636c..d7e2f183 100644 --- a/src/lib/time_summary.rs +++ b/src/lib/time_summary.rs @@ -7,18 +7,18 @@ use crate::types::{CliArgs, Config}; use std::cmp::Ordering; use std::time::SystemTime; -pub(crate) fn is_time_summary_enabled() -> bool { +pub fn is_time_summary_enabled() -> bool { envmnt::is("CARGO_MAKE_PRINT_TIME_SUMMARY") } -pub(crate) fn add(time_summary: &mut Vec<(String, u128)>, name: &str, start_time: SystemTime) { +pub fn add(time_summary: &mut Vec<(String, u128)>, name: &str, start_time: SystemTime) { match start_time.elapsed() { Ok(elapsed) => time_summary.push((name.to_string(), elapsed.as_millis())), _ => (), }; } -pub(crate) fn print(time_summary: &Vec<(String, u128)>) { +pub fn print(time_summary: &Vec<(String, u128)>) { if is_time_summary_enabled() { let mut time_summary_sorted = time_summary.clone(); time_summary_sorted @@ -62,7 +62,7 @@ pub(crate) fn print(time_summary: &Vec<(String, u128)>) { } } -pub(crate) fn init(config: &Config, cli_args: &CliArgs) { +pub fn init(config: &Config, cli_args: &CliArgs) { if config.config.time_summary.unwrap_or(false) || cli_args.print_time_summary || envmnt::is("CARGO_MAKE_CI")