public void Clean(IProject project) { var console = IoC.Get <IConsole>(); console.Clear(); if (project.ToolChain != null) { BuildStarting?.Invoke(this, new BuildEventArgs(BuildType.Clean, project)); TaskRunner.RunTask(() => { project.ToolChain.Clean(IoC.Get <IConsole>(), project).Wait(); Dispatcher.UIThread.InvokeAsync(() => { BuildCompleted?.Invoke(this, new BuildEventArgs(BuildType.Clean, project)); }); }); } else { console.WriteLine($"No toolchain selected for {project.Name}"); } }
public async Task <bool> BuildAsync(IProject project) { bool result = false; SaveAll(); Console.Clear(); if (project.ToolChain != null) { BuildStarting?.Invoke(this, new BuildEventArgs(BuildType.Build, project)); await TaskRunner.RunTask(() => { result = project.ToolChain.Build(Console, project).GetAwaiter().GetResult(); Dispatcher.UIThread.InvokeAsync(() => { BuildCompleted?.Invoke(this, new BuildEventArgs(BuildType.Build, project)); }); }); } else { Console.WriteLine($"No toolchain selected for {project.Name}"); } return(result); }
public void Build(IProject project) { SaveAll(); Console.Clear(); if (project.ToolChain != null) { BuildStarting?.Invoke(this, new BuildEventArgs(BuildType.Build, project)); TaskRunner.RunTask(() => { project.ToolChain.Build(Console, project).Wait(); Dispatcher.UIThread.InvokeAsync(() => { BuildCompleted?.Invoke(this, new BuildEventArgs(BuildType.Build, project)); }); }); } else { Console.WriteLine($"No toolchain selected for {project.Name}"); } }