private static void Build(ProjectInfo projectInfo) { using (var buildContext = new CabwizBuildContext()) { var tasks = projectInfo.CreateBuildTasks(); var feedback = new BuildFeedbackBase(Console.Out); buildContext.Build(tasks, feedback); } }
/// <summary> /// Do background work. Creates a build context and executes the build tasks. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">A DoWorkEventArgs object.</param> private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { using (var textWriter = new TextboxWriter(this.textBox1)) { var feedback = new BuildFeedbackBase(textWriter); var result = this.Context.Build(this.BuildTasks, feedback); e.Result = new WorkResult() { Result = result, Messages = feedback.Messages }; } }