Skip to content

Commit

Permalink
[src/lib/{mod,time_summary}.rs] Make time_summary public ; [src/l…
Browse files Browse the repository at this point in the history
…ib/runner.rs] Make `run_protected_flow` public ; [Cargo.toml] Use official `git_info` and `rust_info` now that my PRs have been merged ;
  • Loading branch information
SamuelMarks committed Aug 30, 2024
1 parent 0219d76 commit a278ef1
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 19 deletions.
10 changes: 6 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lib/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ fn prepare_protected_execution_plan(flow_info: &FlowInfo) -> Result<ExecutionPla
}
}

fn run_protected_flow(
pub fn run_protected_flow(
flow_info: &FlowInfo,
flow_state: Rc<RefCell<FlowState>>,
execution_plan: &ExecutionPlan,
Expand Down
8 changes: 4 additions & 4 deletions src/lib/time_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit a278ef1

Please sign in to comment.