Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.37.14 #1116

Merged
merged 25 commits into from
Jul 17, 2024
Merged

0.37.14 #1116

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
69cbfc8
[src/lib/{mod,cli,cli_parser,runner,descriptor/mod}.rs] Make `pub`lic…
SamuelMarks Jul 8, 2024
6cf5942
[src/lib/**.rs] Make `pub`lic useful symbols for use `cargo-make` as …
SamuelMarks Jul 8, 2024
2234422
[src/lib/*.rs] Percolate exit codes around
SamuelMarks Jul 12, 2024
38780a3
[src/lib/*.rs] Fix tests broken by previous commit ; `rustfmt`
SamuelMarks Jul 12, 2024
a5dd7c6
[src/{main,makers}.rs] Percolate exit code up
SamuelMarks Jul 12, 2024
58fd745
[src/lib/types.rs] Implement helper `either_to_result`
SamuelMarks Jul 12, 2024
2a2e03f
[src/lib/cli.rs] Change function definition of `run` and related func…
SamuelMarks Jul 12, 2024
7354658
Rewrite `panic!` to percolate `Result` throughout, including with new…
SamuelMarks Jul 12, 2024
8bd60c7
Rewrite remaining `panic!` to percolate `Result<_, CargoMakeError>` t…
SamuelMarks Jul 13, 2024
d085444
[src/lib/cli_test.rs] Fix `run_valid` ; [{src/lib/types.rs,Cargo{.tom…
SamuelMarks Jul 13, 2024
3639ec3
Add ExecutionPlanBuilder
06393993 Jul 7, 2024
4dfc585
Fix --skip-init-end-tasks argument
06393993 Jul 7, 2024
cb11b71
[src/lib/error.rs] Remove commented out code that only works in night…
SamuelMarks Jul 13, 2024
78e13aa
[src/lib/cli_parser.rs] Split `add_argument` into own function `add_a…
SamuelMarks Jul 14, 2024
ef1f370
Merge pull request #1109 from 06393993/master
sagiegurari Jul 14, 2024
8769d47
readme
sagiegurari Jul 14, 2024
5247eaf
lock
sagiegurari Jul 14, 2024
8f9fe3e
Merge branch '0.37.14' into cargo-make-as-library
SamuelMarks Jul 14, 2024
0119754
Merge branch '0.37.14' into cargo-make-as-library
SamuelMarks Jul 14, 2024
4564d61
[src/lib/execution_plan.rs] Comment out within `build`: `Err(CargoMak…
SamuelMarks Jul 14, 2024
6f4f4f7
[src/lib/cli_{parser,parser_test,test}.rs] Pass around a `CliSpec` to…
SamuelMarks Jul 15, 2024
8b07c69
Merge pull request #1112 from offscale/cargo-make-as-library
sagiegurari Jul 17, 2024
d621fcb
Merge branch '0.37.14' of github.com:sagiegurari/cargo-make into 0.37.14
sagiegurari Jul 17, 2024
1b485dc
changelog
sagiegurari Jul 17, 2024
3f11e8a
fix mac build
sagiegurari Jul 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## CHANGELOG

### v0.37.14

* Fix: fix the --skip-init-end-tasks argument #1108 (thanks @06393993)
* Enhancement: Support using cargo make as library #1112 (thanks @SamuelMarks)

### v0.37.13 (2024-07-07)

* Enhancement: New condition_script_runner_args attribute #1081
Expand Down
64 changes: 45 additions & 19 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ fsio = { version = "^0.4", features = ["temp-path"] }
git_info = "^0.1.2"
glob = "^0.3.1"
home = "^0.5"
ignore = "^0.4"
indexmap = { version = "^2", features = ["serde"] }
itertools = "^0.13"
ignore = "^0.4"
lenient_semver = "^0.4.2"
log = "^0.4"
once_cell = "^1.19.0"
Expand All @@ -76,6 +76,7 @@ serde_json = "^1"
sha2 = "^0.10"
shell2batch = "^0.4.5"
strip-ansi-escapes = "^0.2"
strum_macros = "0.26.4"
toml = "^0.8"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions docs/api/src/cli/cli.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">static </span>DEFAULT_TASK_NAME: <span class="kw-2">&amp;</span>str = <span class="string">"default"</span>;
<span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">static </span>DEFAULT_OUTPUT_FORMAT: <span class="kw-2">&amp;</span>str = <span class="string">"default"</span>;

<span class="kw">fn </span>run(cli_args: CliArgs, global_config: <span class="kw-2">&amp;</span>GlobalConfig) {
<span class="kw">fn </span>run(&cli_args: CliArgs, global_config: <span class="kw-2">&amp;</span>GlobalConfig) {
<span class="kw">let </span>start_time = SystemTime::now();

recursion_level::increment();
Expand Down Expand Up @@ -354,6 +354,6 @@

<span class="kw">let </span>cli_args = cli_parser::parse(<span class="kw-2">&amp;</span>global_config, <span class="kw-2">&amp;</span>command_name, sub_command);

run(cli_args, <span class="kw-2">&amp;</span>global_config);
run(&cli_args, <span class="kw-2">&amp;</span>global_config);
}
</code></pre></div></section></main></body></html>
45 changes: 22 additions & 23 deletions src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::cli_parser;
use crate::config;
use crate::descriptor;
use crate::environment;
use crate::error::CargoMakeError;
use crate::logger;
use crate::logger::LoggerOptions;
use crate::profile;
Expand All @@ -31,7 +32,7 @@ pub(crate) static DEFAULT_LOG_LEVEL: &str = "info";
pub(crate) static DEFAULT_TASK_NAME: &str = "default";
pub(crate) static DEFAULT_OUTPUT_FORMAT: &str = "default";

fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
pub fn run(cli_args: &CliArgs, global_config: &GlobalConfig) -> Result<(), CargoMakeError> {
let start_time = SystemTime::now();

recursion_level::increment();
Expand Down Expand Up @@ -95,15 +96,8 @@ fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
let env = cli_args.env.clone();

let experimental = cli_args.experimental;
let descriptor_load_result = descriptor::load(&build_file, force_makefile, env, experimental);

let config = match descriptor_load_result {
Ok(config) => config,
Err(ref error) => {
error!("{}", error);
panic!("{}", error);
}
};
let config = descriptor::load(&build_file, force_makefile, env, experimental)?;

let mut time_summary_vec = vec![];
time_summary::add(
&mut time_summary_vec,
Expand All @@ -117,7 +111,7 @@ fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
None => profile::set_additional(&vec![]),
};

let env_info = environment::setup_env(&cli_args, &config, &task, home, &mut time_summary_vec);
let env_info = environment::setup_env(&cli_args, &config, &task, home, &mut time_summary_vec)?;
time_summary::add(&mut time_summary_vec, "[Setup Env]", step_time);

let crate_name = envmnt::get_or("CARGO_MAKE_CRATE_NAME", "");
Expand All @@ -136,27 +130,29 @@ fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
&config,
&cli_args.output_format,
&cli_args.output_file,
cli_args.list_category_steps,
&cli_args.list_category_steps,
cli_args.hide_uninteresting,
);
)
} else if cli_args.diff_execution_plan {
let default_config = descriptor::load_internal_descriptors(true, experimental, None);
let default_config = descriptor::load_internal_descriptors(true, experimental, None)?;
cli_commands::diff_steps::run(
&default_config,
&config,
&task,
&cli_args,
&env_info.crate_info,
);
)
} else if cli_args.print_only {
cli_commands::print_steps::print(
&mut std::io::stdout(),
&config,
&task,
&cli_args.output_format,
cli_args.disable_workspace,
cli_args.skip_tasks_pattern,
&cli_args.skip_tasks_pattern,
&env_info.crate_info,
);
cli_args.skip_init_end_tasks,
)
} else {
runner::run(
config,
Expand All @@ -165,15 +161,18 @@ fn run(cli_args: CliArgs, global_config: &GlobalConfig) {
&cli_args,
start_time,
time_summary_vec,
);
}
)
}?;

Ok(())
}

/// Handles the command line arguments and executes the runner.
pub(crate) fn run_cli(command_name: String, sub_command: bool) {
let global_config = config::load();
pub fn run_cli(command_name: String, sub_command: bool) -> Result<CliArgs, CargoMakeError> {
let global_config = config::load()?;

let cli_args = cli_parser::parse(&global_config, &command_name, sub_command);
let cli_args = cli_parser::parse(&global_config, &command_name, sub_command)?;

run(cli_args, &global_config);
run(&cli_args, &global_config)?;
Ok(cli_args)
}
Loading