Skip to content

Commit

Permalink
Fixed disabled not checked in platform override task
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiegurari committed Jul 3, 2017
1 parent 09b531a commit c5b3579
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-make"
version = "0.3.2"
version = "0.3.3"
authors = ["Sagie Gur-Ari <[email protected]>"]
description = "Rust task runner and build tool."
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ See [contributing guide](.github/CONTRIBUTING.md)

| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2017-07-03 | v0.3.2 | Fixed disabled not checked in platform override task |
| 2017-07-03 | v0.3.3 | Fixed disabled not checked in platform override task |
| 2017-07-02 | v0.3.1 | Added CARGO_MAKE_TASK env var holding the main task name |
| 2017-07-02 | v0.3.0 | Renamed few cli options |
| 2017-07-02 | v0.2.20 | Added -v and --verbose cli arg |
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ See [contributing guide](https://github.com/sagiegurari/cargo-make/blob/master/.

| Date | Version | Description |
| ----------- | ------- | ----------- |
| 2017-07-03 | v0.3.2 | Fixed disabled not checked in platform override task |
| 2017-07-03 | v0.3.3 | Fixed disabled not checked in platform override task |
| 2017-07-02 | v0.3.1 | Added CARGO_MAKE_TASK env var holding the main task name |
| 2017-07-02 | v0.3.0 | Renamed few cli options |
| 2017-07-02 | v0.2.20 | Added -v and --verbose cli arg |
Expand Down
20 changes: 5 additions & 15 deletions docs/api/src/cargo_make/runner.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,6 @@
<span id="165">165</span>
<span id="166">166</span>
<span id="167">167</span>
<span id="168">168</span>
<span id="169">169</span>
<span id="170">170</span>
<span id="171">171</span>
<span id="172">172</span>
</pre><pre class="rust ">
<span class="doccomment">//! # runner</span>
<span class="doccomment">//!</span>
Expand Down Expand Up @@ -305,18 +300,13 @@
};

<span class="kw">if</span> <span class="op">!</span><span class="ident">task_names</span>.<span class="ident">contains</span>(<span class="ident">task</span>) {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">add</span> <span class="op">=</span> <span class="op">!</span><span class="ident">task_config</span>.<span class="ident">disabled</span>.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>);
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">clone_task</span> <span class="op">=</span> <span class="ident">task_config</span>.<span class="ident">clone</span>();
<span class="kw">let</span> <span class="ident">normalized_task</span> <span class="op">=</span> <span class="ident">clone_task</span>.<span class="ident">get_normalized_task</span>();
<span class="kw">let</span> <span class="ident">add</span> <span class="op">=</span> <span class="op">!</span><span class="ident">normalized_task</span>.<span class="ident">disabled</span>.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>);

<span class="kw">if</span> <span class="ident">add</span> {
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">clone_task</span> <span class="op">=</span> <span class="ident">task_config</span>.<span class="ident">clone</span>();
<span class="kw">let</span> <span class="ident">normalized_task</span> <span class="op">=</span> <span class="ident">clone_task</span>.<span class="ident">get_normalized_task</span>();

<span class="ident">add</span> <span class="op">=</span> <span class="op">!</span><span class="ident">normalized_task</span>.<span class="ident">disabled</span>.<span class="ident">unwrap_or</span>(<span class="bool-val">false</span>);

<span class="kw">if</span> <span class="ident">add</span> {
<span class="ident">steps</span>.<span class="ident">push</span>(<span class="ident">Step</span> { <span class="ident">name</span>: <span class="ident">task</span>.<span class="ident">to_string</span>(), <span class="ident">config</span>: <span class="ident">normalized_task</span> });
<span class="ident">task_names</span>.<span class="ident">insert</span>(<span class="ident">task</span>.<span class="ident">to_string</span>());
}
<span class="ident">steps</span>.<span class="ident">push</span>(<span class="ident">Step</span> { <span class="ident">name</span>: <span class="ident">task</span>.<span class="ident">to_string</span>(), <span class="ident">config</span>: <span class="ident">normalized_task</span> });
<span class="ident">task_names</span>.<span class="ident">insert</span>(<span class="ident">task</span>.<span class="ident">to_string</span>());
}
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">root</span> {
<span class="ident">logger</span>.<span class="ident">error</span>::<span class="op">&lt;</span>()<span class="op">&gt;</span>(<span class="string">&quot;Circular reference found for task: &quot;</span>, <span class="kw-2">&amp;</span>[<span class="kw-2">&amp;</span><span class="ident">task</span>], <span class="prelude-val">None</span>);
Expand Down
15 changes: 5 additions & 10 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,13 @@ fn create_execution_plan_for_step(
};

if !task_names.contains(task) {
let mut add = !task_config.disabled.unwrap_or(false);
let mut clone_task = task_config.clone();
let normalized_task = clone_task.get_normalized_task();
let add = !normalized_task.disabled.unwrap_or(false);

if add {
let mut clone_task = task_config.clone();
let normalized_task = clone_task.get_normalized_task();

add = !normalized_task.disabled.unwrap_or(false);

if add {
steps.push(Step { name: task.to_string(), config: normalized_task });
task_names.insert(task.to_string());
}
steps.push(Step { name: task.to_string(), config: normalized_task });
task_names.insert(task.to_string());
}
} else if root {
logger.error::<()>("Circular reference found for task: ", &[&task], None);
Expand Down

0 comments on commit c5b3579

Please sign in to comment.