예제 #1
0
        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}");
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
        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}");
            }
        }