mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-15 15:09:29 +00:00
Cleaned up
Cleaned up the Program.cs for the Cake Frosting project. Added the working direcotry directive
This commit is contained in:
+1
-43
@@ -9,49 +9,7 @@ public static class Program
|
||||
{
|
||||
return new CakeHost()
|
||||
.UseContext<BuildContext>()
|
||||
.UseWorkingDirectory("../")
|
||||
.Run(args);
|
||||
}
|
||||
}
|
||||
|
||||
public class BuildContext : FrostingContext
|
||||
{
|
||||
public bool Delay { get; set; }
|
||||
|
||||
public BuildContext(ICakeContext context)
|
||||
: base(context)
|
||||
{
|
||||
Delay = context.Arguments.HasArgument("delay");
|
||||
}
|
||||
}
|
||||
|
||||
[TaskName("Hello")]
|
||||
public sealed class HelloTask : FrostingTask<BuildContext>
|
||||
{
|
||||
public override void Run(BuildContext context)
|
||||
{
|
||||
context.Log.Information("Hello");
|
||||
}
|
||||
}
|
||||
|
||||
[TaskName("World")]
|
||||
[IsDependentOn(typeof(HelloTask))]
|
||||
public sealed class WorldTask : AsyncFrostingTask<BuildContext>
|
||||
{
|
||||
// Tasks can be asynchronous
|
||||
public override async Task RunAsync(BuildContext context)
|
||||
{
|
||||
if (context.Delay)
|
||||
{
|
||||
context.Log.Information("Waiting...");
|
||||
await Task.Delay(1500);
|
||||
}
|
||||
|
||||
context.Log.Information("World");
|
||||
}
|
||||
}
|
||||
|
||||
[TaskName("Default")]
|
||||
[IsDependentOn(typeof(WorldTask))]
|
||||
public class DefaultTask : FrostingTask
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user