GithubHelp home page GithubHelp logo

Comments (3)

nightroman avatar nightroman commented on May 23, 2024

This parameter would be a redundant feature. For you it will make the syntax
"better". For some other users it may be confusing. A redundant feature, as
such, may exist. But there must be really good reasons for it.

Let me try to explain the reasoning of the design. First of all, the used term
"task dependency" is not quite right for Invoke-Build tasks. Unlike other tasks
runners, it uses the original (perhaps unique) concept of jobs, where jobs are
task references and own actions in any required order.

This covers the classic "task dependency" scenarios

task Foo Bar, { }

but it is not limited to them. For example, in this case

task Foo { }, Bar

it is not quite right to say Foo depends on Bar, because Bar is invoked
after the own action of Foo. The task Bar is a post task, continuation.
Such cases are less frequent but they exist and they are supported.

Also, you can do something "crazy" (if you need, of course):

task Main Task1, { }, Task2, { }, Task3

This is also good for potential future changes. For a given task X with jobs,
you may move its action to a separate task and replace it with this task
reference. Or a task reference may be replaced with an action. Or you
may reorder, add, remove jobs. In any case, the syntax of X does not
change, just its job list changes.

So the syntax is driven by the concept of flexible jobs instead of the rigid
approach task -depends -action. The syntax also turns out to be concise,
which is probably good, but this was not the goal at all.

If you like you may use the parameter name -Jobs explicitly to emphasize
that its argument is an array and commas are expected. It is just a matter of
time to get used to the syntax and think in terms of "jobs", not "dependencies".

from invoke-build.

nightroman avatar nightroman commented on May 23, 2024

In other words, different concepts require different parameters.

A task in psake is a named list of dependencies and one action where
dependencies are task references. So it reflects this concept by two task
parameters, Depends and Action. (It also has PreAction and PostAction).

A task in Invoke-Build is a named list of jobs where jobs are task references
and actions in any required number and order. So it reflects this concept by
one parameter, Jobs. It would be unnatural to support an extra parameter
Depends just because another tool uses it due to the different concept.
(Note that PreAction and PostAction are also covered by Jobs).

from invoke-build.

michael-baker avatar michael-baker commented on May 23, 2024

Thanks for the detailed reply. It covers off concept of jobs nicely and the subtle differences compared to dependencies in other task system. I'll try out -Jobs anyway.

from invoke-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.