From f66518ecc28d95d06589ba03aeebd5dd47f26e60 Mon Sep 17 00:00:00 2001 From: sagie gur ari Date: Sat, 24 Jun 2017 21:09:12 +0000 Subject: [PATCH] renamed dependencies attribute and added coverage --- Cargo.toml | 2 +- README.md | 39 ++++++++++++----------- docs/api/cargo_make/index.html | 2 +- docs/api/src/cargo_make/installer.rs.html | 4 +-- docs/api/src/cargo_make/main.rs.html | 2 +- docs/api/src/cargo_make/runner.rs.html | 8 ++--- docs/api/src/cargo_make/types.rs.html | 4 +-- examples/alias.toml | 6 ++-- examples/depedencies.toml | 6 ++-- examples/script.toml | 2 +- examples/simple-example.toml | 6 ++-- src/default.toml | 12 +++---- src/installer.rs | 4 +-- src/main.rs | 2 +- src/runner.rs | 8 ++--- src/types.rs | 4 +-- 16 files changed, 56 insertions(+), 55 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0d1d668e..28bc82e6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-make" -version = "0.1.2" +version = "0.2.0" authors = ["Sagie Gur-Ari "] description = "Rust task runner and build tool." license = "Apache-2.0" diff --git a/README.md b/README.md index b647b99e..0602752a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ * [Installation](#installation) * [Usage](#usage) * [Simple Example](#usage-simple) - * [Tasks, Depedencies and Aliases](#usage-task-depedencies-alias) + * [Tasks, Dependencies and Aliases](#usage-task-dependencies-alias) * [Default Tasks and Extending](#usage-default-tasks) * [Continues Integration](#usage-ci) * [Environment Variables](#usage-env) @@ -25,7 +25,7 @@ ## Overview The cargo-make task runner enables to define and configure sets of tasks and run them as a flow.
A task is a command or a script to execute.
-Tasks can have depedencies which are also tasks that will be executed before the task itself.
+Tasks can have dependencies which are also tasks that will be executed before the task itself.
With a simple toml based configuration file, you can define a multi platform build script that can run build, test, documentation generation, bench tests execution, security validations and more by running a single command. @@ -68,15 +68,15 @@ args = ["clean"] [tasks.build] command = "cargo" args = ["build"] -depedencies = ["clean"] +dependencies = ["clean"] [tasks.test] command = "cargo" args = ["test"] -depedencies = ["clean"] +dependencies = ["clean"] [tasks.my-flow] -depedencies = [ +dependencies = [ "format", "build", "test" @@ -149,8 +149,8 @@ test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out We now created a build script that can run on any platform. - -### Tasks, Depedencies and Aliases + +### Tasks, Dependencies and Aliases In many cases, certain tasks depend on other tasks.
For example you would like to format the code before running build and run the build before running tests.
Such flow can be defined as follows: @@ -164,12 +164,12 @@ args = ["fmt", "--", "--write-mode=overwrite"] [tasks.build] command = "cargo" args = ["build"] -depedencies = ["format"] +dependencies = ["format"] [tasks.test] command = "cargo" args = ["test"] -depedencies = ["build"] +dependencies = ["build"] ```` When you run: @@ -178,21 +178,21 @@ When you run: cargo make -b ./my_build.toml -t test ```` -It will try to run test, see that it has depedencies and those have other depedencies.
-Therefore it will create an execution plan for the tasks based on the tasks and their depedencies.
+It will try to run test, see that it has dependencies and those have other dependencies.
+Therefore it will create an execution plan for the tasks based on the tasks and their dependencies.
In our case it will invoke format -> build -> test.
The same task will never be executed twice so if we have for example: ````toml [tasks.A] -depedencies = ["B", "C"] +dependencies = ["B", "C"] [tasks.B] -depedencies = ["D"] +dependencies = ["D"] [tasks.C] -depedencies = ["D"] +dependencies = ["D"] [tasks.D] script = [ @@ -200,7 +200,7 @@ script = [ ] ```` -In this example, A depdends on B and C, and both B and C are depedended on D.
+In this example, A depends on B and C, and both B and C are dependended on D.
Task D however will not be invoked twice.
The output of the execution will look something like this: @@ -225,13 +225,13 @@ So now, if we want to have D execute twice we can do the following: ````toml [tasks.A] -depedencies = ["B", "C"] +dependencies = ["B", "C"] [tasks.B] -depedencies = ["D"] +dependencies = ["D"] [tasks.C] -depedencies = ["D2"] +dependencies = ["D2"] [tasks.D] script = [ @@ -339,7 +339,7 @@ OPTIONS: ## Roadmap -The cargo-make task runner is still in initial development and there are many things planned for the comming release.
+The cargo-make task runner is still in initial development and there are many things planned for the coming release.
Here are a few of the top priorities: * Support platform specific task overrides @@ -358,6 +358,7 @@ See [contributing guide](.github/CONTRIBUTING.md) | Date | Version | Description | | ----------- | ------- | ----------- | +| 2017-06-24 | v0.2.0 | Internal fixes (renamed dependencies attribute) | | 2017-06-24 | v0.1.2 | Print build time, added internal docs, unit tests and coverage | | 2017-06-24 | v0.1.1 | Added support for env vars, task alias and crate installation | | 2017-06-23 | v0.1.0 | Initial release. | diff --git a/docs/api/cargo_make/index.html b/docs/api/cargo_make/index.html index ec2d449b..b502cb65 100644 --- a/docs/api/cargo_make/index.html +++ b/docs/api/cargo_make/index.html @@ -54,7 +54,7 @@

cargo-make<

Rust task runner and build tool.
The cargo-make task runner enables to define and configure sets of tasks and run them as a flow.
A task is a command or a script to execute.
-Tasks can have depedencies which are also tasks that will be executed before the task itself.
+Tasks can have dependencies which are also tasks that will be executed before the task itself.
With a simple toml based configuration file, you can define a multi platform build script that can run build, test, documentation generation, bench tests execution, security validations and more by running a single command.

diff --git a/docs/api/src/cargo_make/installer.rs.html b/docs/api/src/cargo_make/installer.rs.html index f1b56dda..eaa59229 100644 --- a/docs/api/src/cargo_make/installer.rs.html +++ b/docs/api/src/cargo_make/installer.rs.html @@ -143,8 +143,8 @@
 //! # installer
 //!
-//! Installs external depedencies for tasks.<br>
-//! There are 2 types of depedencies: install_crate, install_script.<br>
+//! Installs external dependencies for tasks.<br>
+//! There are 2 types of dependencies: install_crate, install_script.<br>
 //! install_crate ensures the crate command is available and if not installs the crate based on the provided name.<br>
 //! install_script always gets executed before the task command.
 //!
diff --git a/docs/api/src/cargo_make/main.rs.html b/docs/api/src/cargo_make/main.rs.html
index 65667966..03b2a028 100644
--- a/docs/api/src/cargo_make/main.rs.html
+++ b/docs/api/src/cargo_make/main.rs.html
@@ -272,7 +272,7 @@
 //! Rust task runner and build tool.<br>
 //! The cargo-make task runner enables to define and configure sets of tasks and run them as a flow.<br>
 //! A task is a command or a script to execute.<br>
-//! Tasks can have depedencies which are also tasks that will be executed before the task itself.<br>
+//! Tasks can have dependencies which are also tasks that will be executed before the task itself.<br>
 //! With a simple toml based configuration file, you can define a multi platform build script that can run build, test,
 //! documentation generation, bench tests execution, security validations and more by running a single command.
 //!
diff --git a/docs/api/src/cargo_make/runner.rs.html b/docs/api/src/cargo_make/runner.rs.html
index 3873e3b4..57763a67 100644
--- a/docs/api/src/cargo_make/runner.rs.html
+++ b/docs/api/src/cargo_make/runner.rs.html
@@ -248,13 +248,13 @@
 
     match config.tasks.get(&actual_task) {
         Some(task_config) => {
-            match task_config.depedencies {
-                Some(ref depedencies) => {
-                    for depedency in depedencies {
+            match task_config.dependencies {
+                Some(ref dependencies) => {
+                    for depedency in dependencies {
                         create_execution_plan_for_step(&logger, &config, &depedency, steps, task_names, false);
                     }
                 }
-                _ => logger.verbose::<()>("No depedencies found for task: ", &[&task], None),
+                _ => logger.verbose::<()>("No dependencies found for task: ", &[&task], None),
             };
 
             if !task_names.contains(task) {
diff --git a/docs/api/src/cargo_make/types.rs.html b/docs/api/src/cargo_make/types.rs.html
index a2b80deb..5ce1f7dd 100644
--- a/docs/api/src/cargo_make/types.rs.html
+++ b/docs/api/src/cargo_make/types.rs.html
@@ -111,7 +111,7 @@
 use std::collections::HashMap;
 
 #[derive(Serialize, Deserialize, Debug, Clone)]
-/// Holds a single task configuration such as command and depedencies list
+/// Holds a single task configuration such as command and dependencies list
 pub struct Task {
     /// if defined, task points to another task and all other properties are ignored
     pub alias: Option<String>,
@@ -126,7 +126,7 @@
     /// If command is not defined, and script is defined, the provided script will be executed
     pub script: Option<Vec<String>>,
     /// A list of tasks to execute before this task
-    pub depedencies: Option<Vec<String>>
+    pub dependencies: Option<Vec<String>>
 }
 
 #[derive(Serialize, Deserialize, Debug)]
diff --git a/examples/alias.toml b/examples/alias.toml
index aae99ea3..876fa058 100644
--- a/examples/alias.toml
+++ b/examples/alias.toml
@@ -1,12 +1,12 @@
 
 [tasks.A]
-depedencies = ["B", "C"]
+dependencies = ["B", "C"]
 
 [tasks.B]
-depedencies = ["D"]
+dependencies = ["D"]
 
 [tasks.C]
-depedencies = ["D2"]
+dependencies = ["D2"]
 
 [tasks.D]
 script = [
diff --git a/examples/depedencies.toml b/examples/depedencies.toml
index 3dbfdfa8..2147ff64 100644
--- a/examples/depedencies.toml
+++ b/examples/depedencies.toml
@@ -1,12 +1,12 @@
 
 [tasks.A]
-depedencies = ["B", "C"]
+dependencies = ["B", "C"]
 
 [tasks.B]
-depedencies = ["D"]
+dependencies = ["D"]
 
 [tasks.C]
-depedencies = ["D"]
+dependencies = ["D"]
 
 [tasks.D]
 script = [
diff --git a/examples/script.toml b/examples/script.toml
index b24929cc..9fd2cb7a 100644
--- a/examples/script.toml
+++ b/examples/script.toml
@@ -7,4 +7,4 @@ script = [
 ]
 
 [tasks.default]
-depedencies = ["hello-world"]
+dependencies = ["hello-world"]
diff --git a/examples/simple-example.toml b/examples/simple-example.toml
index 4953f78d..f6b3e42f 100644
--- a/examples/simple-example.toml
+++ b/examples/simple-example.toml
@@ -10,15 +10,15 @@ args = ["clean"]
 [tasks.build]
 command = "cargo"
 args = ["build"]
-depedencies = ["clean"]
+dependencies = ["clean"]
 
 [tasks.test]
 command = "cargo"
 args = ["test"]
-depedencies = ["clean"]
+dependencies = ["clean"]
 
 [tasks.my-flow]
-depedencies = [
+dependencies = [
     "format",
     "build",
     "test"
diff --git a/src/default.toml b/src/default.toml
index 7052a59b..e9b27f90 100644
--- a/src/default.toml
+++ b/src/default.toml
@@ -3,12 +3,12 @@
 RUST_BACKTRACE="1"
 
 [tasks.default]
-depedencies = [
+dependencies = [
     "dev-test-flow"
 ]
 
 [tasks.ci-flow]
-depedencies = [
+dependencies = [
     "pre-build",
     "build-verbose",
     "post-build",
@@ -18,7 +18,7 @@ depedencies = [
 ]
 
 [tasks.dev-test-flow]
-depedencies = [
+dependencies = [
     "format-flow",
     "pre-build",
     "build",
@@ -29,7 +29,7 @@ depedencies = [
 ]
 
 [tasks.build-flow]
-depedencies = [
+dependencies = [
     "init",
     "pre-clean",
     "clean-apidocs",
@@ -82,7 +82,7 @@ args = ["fmt", "--", "--write-mode=overwrite"]
 [tasks.post-format]
 
 [tasks.format-flow]
-depedencies = [
+dependencies = [
     "pre-format",
     "format",
     "post-format"
@@ -129,7 +129,7 @@ args = ["bench"]
 [tasks.post-bench]
 
 [tasks.bench-flow]
-depedencies = [
+dependencies = [
     "pre-bench",
     "bench",
     "post-bench"
diff --git a/src/installer.rs b/src/installer.rs
index 335b538d..fbff4be3 100644
--- a/src/installer.rs
+++ b/src/installer.rs
@@ -1,7 +1,7 @@
 //! # installer
 //!
-//! Installs external depedencies for tasks.
-//! There are 2 types of depedencies: install_crate, install_script.
+//! Installs external dependencies for tasks.
+//! There are 2 types of dependencies: install_crate, install_script.
//! install_crate ensures the crate command is available and if not installs the crate based on the provided name.
//! install_script always gets executed before the task command. //! diff --git a/src/main.rs b/src/main.rs index a4bee2e8..9f27e165 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,7 +73,7 @@ //! Rust task runner and build tool.
//! The cargo-make task runner enables to define and configure sets of tasks and run them as a flow.
//! A task is a command or a script to execute.
-//! Tasks can have depedencies which are also tasks that will be executed before the task itself.
+//! Tasks can have dependencies which are also tasks that will be executed before the task itself.
//! With a simple toml based configuration file, you can define a multi platform build script that can run build, test, //! documentation generation, bench tests execution, security validations and more by running a single command. //! diff --git a/src/runner.rs b/src/runner.rs index 77da7855..374a7f96 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -64,13 +64,13 @@ fn create_execution_plan_for_step( match config.tasks.get(&actual_task) { Some(task_config) => { - match task_config.depedencies { - Some(ref depedencies) => { - for depedency in depedencies { + match task_config.dependencies { + Some(ref dependencies) => { + for depedency in dependencies { create_execution_plan_for_step(&logger, &config, &depedency, steps, task_names, false); } } - _ => logger.verbose::<()>("No depedencies found for task: ", &[&task], None), + _ => logger.verbose::<()>("No dependencies found for task: ", &[&task], None), }; if !task_names.contains(task) { diff --git a/src/types.rs b/src/types.rs index a01187fc..388f4ca8 100644 --- a/src/types.rs +++ b/src/types.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; #[derive(Serialize, Deserialize, Debug, Clone)] -/// Holds a single task configuration such as command and depedencies list +/// Holds a single task configuration such as command and dependencies list pub struct Task { /// if defined, task points to another task and all other properties are ignored pub alias: Option, @@ -21,7 +21,7 @@ pub struct Task { /// If command is not defined, and script is defined, the provided script will be executed pub script: Option>, /// A list of tasks to execute before this task - pub depedencies: Option> + pub dependencies: Option> } #[derive(Serialize, Deserialize, Debug)]