Skip to content

Instantly share code, notes, and snippets.

@siennathesane
Created June 17, 2019 01:25
Show Gist options
  • Save siennathesane/4472ace667d96fcd6aeb69160f425eca to your computer and use it in GitHub Desktop.
Save siennathesane/4472ace667d96fcd6aeb69160f425eca to your computer and use it in GitHub Desktop.
var target = Argument("target", "Welcome");
List<string> tasks = new List<string>();
Setup(context => {
foreach(var task in context.TasksToExecute) {
Information("task: {0}", task.Name);
tasks.Append(task.Name);
}
});
Task("A").Description("Performs A").Does(() => {});
Task("B").Description("Performs B").Does(() => {});
Task("C").IsDependentOn("B").Description("Performs C after A and B").Does(() => {});
Task("Welcome")
.Does(() => {
Information("Welcome to the Build Environment. Please run one of the targets: {0}", string.Join(", ", tasks));
Environment.Exit(0);
});
RunTarget(target);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment