Included Taskfiles can have includes #623
Replies: 4 comments
-
Hi @ameershira-uman, thank you for starting a discussion on this topic. I'm also going to mention #390 for reference/backlink since this discussion is happening in multiple places. I agree with a lot of the points you've brought up here and have the exact same set of issues on my project! You've described the limitations of this issue much more elegantly than I could have. I've put up a PR for this functionality at #656. |
Beta Was this translation helpful? Give feedback.
-
We have a situation where we'd like to generate an intermediary package_a/Taskfile.ymlversion: "3"
tasks:
clean: echo 'clean' tasks/Taskfile.packages.yml (generated)version: '3'
includes:
package_a:
taskfile: ../packages/package_a
dir: ../packages/package_a
package_b:
taskfile: ../packages/package_b
dir: ../packages/package_b
package_c:
taskfile: ../packages/package_c
dir: ../packages/package_c
package_d:
taskfile: ../packages/package_d
dir: ../packages/package_d
package_e:
taskfile: ../packages/package_e
dir: ../packages/package_e
package_f:
taskfile: ../packages/package_f
dir: ../packages/package_f
tasks:
clean:
deps:
- 'package_a:clean'
- 'package_e:clean'
- 'package_f:clean'
- 'package_d:clean'
- 'package_c:clean'
- 'package_b:clean'
test:
deps:
- 'package_e:test'
- 'package_d:test'
- 'package_c:test'
- 'package_b:test'
analyze:
deps:
- 'package_b:analyze' Taskfile.ymlversion: "3"
includes:
packages: ./tasks/Taskfile.packages.yml
tasks:
clean:
desc: Run flutter clean on app and all packages
cmds:
- task: packages:clean
- flutter clean |
Beta Was this translation helpful? Give feedback.
-
Looks like we have a PR that addresses this which has been sitting waiting for final review for about a month #656 |
Beta Was this translation helpful? Give feedback.
-
Just merged as #656 |
Beta Was this translation helpful? Give feedback.
-
Hi @andreynering
I have a use case for the "Included Taskfiles can't have includes. Please, move the include to the main Taskfile" message.
I have a project that includes a git submodule, that includes a git submodule, that includes a git submodule.
So to say "Included Taskfiles can't have includes" is not really something we can always control. And I would like to do the following:
From the highest-level project I would like to call the deps-check task, and this task would call the deps-check of the subproject, which should call the deps-check task of its subproject etc. This chain allows us to abstract the projects correctly as the highest level project should not need to change its taskfile when the lowest level project changes - it should not be that aware.
From the highest-level project I would like to call the build task. The build task would depend on the subproject build task which would depend on its subproject build task which depends on its subproject build task. In order for the main project to run, the lowest level library needs to be built, and every other going up the dependency tree.
The goal of writing once and using in as many use cases as possible is crippled by the "Included Taskfiles can't have includes" rule.
I'm hoping that I am completely incorrect and that there is a better way to do this.
If we are concerned about having too many tasks being accessible on the highest level project, then would it not make sense to explicitly select which tasks to include and expose from an included taskfile? This way only the relevant tasks are filtered up to the top-level project?
Looking forward to your feedback.
Kind Regards
Beta Was this translation helpful? Give feedback.
All reactions