Skip to content

Check if task has executed #3225

Answered by nils-a
mgnslndh asked this question in Q&A
Mar 3, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I'm not aware of such a feature. However, this is quickly implemented in Cake Frosting.

The idea is to implement a FrostingTaskLifetime that will simply add the current task to a list of tasks that have been executed. That way you could simply "ask" the list which task has been run already.

I've modified the starter project to demonstrate that.:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Cake.Core;
using Cake.Core.Diagnostics;
using Cake.Frosting;

public static class Program
{
    public static int Main(string[] args)
    {
        return new CakeHost()
            .UseContext<BuildContext>()
            .UseTaskLifetime<TaskLif…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mgnslndh
Comment options

Answer selected by mgnslndh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants