Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsDependentOn with multiple tasks #1462

Open
jnm2 opened this issue Jan 16, 2017 · 3 comments
Open

IsDependentOn with multiple tasks #1462

jnm2 opened this issue Jan 16, 2017 · 3 comments

Comments

@jnm2
Copy link
Contributor

jnm2 commented Jan 16, 2017

I'd like to be able to use IsDependentOn(IEnumerable<> tasks):

var tests = new[]
{
    Task("Test 1").Does(() =>
    {
        // ...
    }),
    Task("Test 2").Does(() =>
    {
        // ...
    }),
    Task("Process output containing format string should succeed").Does(() =>
    {
        // ...
    }),
};


var target = Argument("target", "Default");

Task("Default")
    .IsDependentOn(tests);

RunTarget(target);
@devlead
Copy link
Member

devlead commented Jan 16, 2017

That's just an extension method so sounds like a reasonable addition, wouldn't break anything.

@dhming
Copy link

dhming commented May 5, 2017

That a very good suggestion. I think we can also add such an extension method like IsDependentOn("task1", "task2", "taskN") or IsDependentOn("task1,task2,taskN")

@jnm2
Copy link
Contributor Author

jnm2 commented May 5, 2017

These would be good:

 public static CakeTaskBuilder<T> IsDependentOn<T>(this CakeTaskBuilder<T> builder,
    string name) where T : CakeTask
+public static CakeTaskBuilder<T> IsDependentOn<T>(this CakeTaskBuilder<T> builder,
+    params string[] names) where T : CakeTask
+public static CakeTaskBuilder<T> IsDependentOn<T>(this CakeTaskBuilder<T> builder,
+    IEnumerable<string> names) where T : CakeTask
 public static CakeTaskBuilder<T> IsDependentOn<T, TOther>(this CakeTaskBuilder<T> builder,
     CakeTaskBuilder<TOther> other) where T : CakeTask where TOther : CakeTask
+public static CakeTaskBuilder<T> IsDependentOn<T, TOther>(this CakeTaskBuilder<T> builder,
+    params CakeTaskBuilder<TOther>[] others) where T : CakeTask where TOther : CakeTask
+public static CakeTaskBuilder<T> IsDependentOn<T, TOther>(this CakeTaskBuilder<T> builder,
+    IEnumerable<CakeTaskBuilder<TOther>> others) where T : CakeTask where TOther : CakeTask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants