GH-4517 - Cake Frosting WithCriteria Description #4518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Marked the current ShouldRun method obsolete.
Added a new property to IFrostingTask, ShouldRunCriteria which is a List of CakeTaskCriteria. This allows you to have multiple criteria just like what could be done in Cake.Tool.
The current method of the ShouldRun method that you could override and the SkippedMessage has shortcoming when compared to Cake.Tool. First the SkippedMessage could not be set the way it is currently implemented and it only allowed for one message for the task being skipped. It could not be changed if you had multiple criteria to check for skipping a task.
The new ShouldRunCriteria property allows you to setup multiple criteria and have a different message for each one just like Cake.Tool.
This would be nice to have in 5.1 to allow me to continue converting a current cake recipe here at work over to Cake.Frosting. The one downfall is since Cake.Frosting does not support the Spectre Console output the skipped messages are not shown in the summary at this time.