|
48 | 48 | hallo: welt |
49 | 49 | ``` |
50 | 50 |
|
51 | | -## OS specific task |
| 51 | +## Operating System specific tasks |
52 | 52 |
|
53 | 53 | If you add a `Taskfile_{{GOOS}}.yml` you can override or amend your Taskfile |
54 | 54 | based on the operating system. |
@@ -86,6 +86,31 @@ It's also possible to have an OS specific `Taskvars.yml` file, like |
86 | 86 | `Taskvars_windows.yml`, `Taskfile_linux.yml`, or `Taskvars_darwin.yml`. See the |
87 | 87 | [variables section](#variables) below. |
88 | 88 |
|
| 89 | +## Including other Taskfiles |
| 90 | + |
| 91 | +If you want to share tasks between different projects (Taskfiles), you can use |
| 92 | +the importing mechanism to include other Taskfiles using the `includes` keyword: |
| 93 | + |
| 94 | +```yaml |
| 95 | +version: '2' |
| 96 | +
|
| 97 | +includes: |
| 98 | + docs: ./documentation # will look for ./documentation/Taskfile.yml |
| 99 | + docker: ./DockerTasks.yml |
| 100 | +``` |
| 101 | + |
| 102 | +The tasks described in the given Taskfiles will be available with the informed |
| 103 | +namespace. So, you'd call `task docs:serve` to run the `serve` task from |
| 104 | +`documentation/Taskfile.yml` or `task docker:build` to run the `build` task |
| 105 | +from the `DockerTasks.yml` file. |
| 106 | + |
| 107 | +> The included Taskfiles must be using the same schema version the main |
| 108 | +> Taskfile uses. |
| 109 | + |
| 110 | +> Also, for now included Taskfiles can't include other Taskfiles. |
| 111 | +> This was a deliberate decision to keep use and implementation simple. |
| 112 | +> If you disagree, open an GitHub issue and explain your use case. =) |
| 113 | + |
89 | 114 | ## Task directory |
90 | 115 |
|
91 | 116 | By default, tasks will be executed in the directory where the Taskfile is |
|
0 commit comments