Conditional task dependencies
- Dominant language
- C#
- Stars
- 4.2k
- Forks
- 778
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 19
Description
I was just trying to figure out a way to do conditional dependencies between tasks, particularly as a means to get incremental build behavior.
It's not directly supported through the task DSL, but I figured I'd see if anyone has ideas on how I might achieve this.
If not, maybe this would be a nice enhancement :smile:
Here's a simplified example of what I'm trying to do:
Let's say I have a Build task and a Package task.
I only want to run the Build task if my bin is empty (or older than the source files, or whatever).
Otherwise, I'll just package the artifacts that are already in the bin.
Obviously I can set up a `WithCriteria` on the Build task, but I don't really want to the Build task to be responsible for that, as I don't always want that rule to be applied every time the Build task is invoked -- I'd rather apply that condition contextually.
I actually expected that if a Task's `WithCriteria` isn't satisfied, that the tasks it depends on would not be invoked. That doesn't seem to be the case, though. The dependencies always get invoked, and only the task with the unsatisfied Criteria gets skipped.
Any thoughts?
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating the task dependency and WithCriteria handling, then define and test contextual conditional dependencies so skipped conditions do not invoke their dependencies while preserving direct task behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100