private void BuildAll() { IsBuilding = true; buildHelper = new BuildHelper(this); buildProject.ClearLog(); AppendLog("Build started"); int retCode = 0; bool successed = true; foreach (var proj in projBuilds) { if (proj.IsExternal) { AppendLog(String.Format("Project \"{0}\" skipped as external.", proj.Name)); continue; } if (proj.Status == Project.BuildStatus.Success) { AppendLog(String.Format("Project \"{0}\" skipped as successful.", proj.Name)); continue; } if(proj.ProjectTree.Any(p => p.Status == Project.BuildStatus.Failed)) { AppendLog(String.Format("Project \"{0}\" skipped as unavailable to build due to fails in dependency projects.", proj.Name)); continue; } proj.Status = Project.BuildStatus.Progress; proj.ClearLog(); retCode = buildHelper.RunProcess(proj, devEnvPath, String.Format("\"{0}\" /clean \"{1}\"", solutionFile.FullName, solutionConfig)); if (retCode != 0) { proj.Status = Project.BuildStatus.Failed; AppendLog(String.Format("Solution clear failed.")); successed = false; continue; } retCode = buildHelper.RunProcess(proj, devEnvPath, String.Format("\"{0}\" /build \"{1}\" /project \"{2}\"", solutionFile.FullName, solutionConfig, proj.Name)); if (retCode != 0) { proj.Status = Project.BuildStatus.Failed; AppendLog(String.Format("Project \"{0}\" build failed.", proj.Name)); successed = false; continue; } proj.Status = Project.BuildStatus.Success; AppendLog(String.Format("Project \"{0}\" build successful.", proj.Name)); } buildHelper = null; OnBuildComplete(successed); }
public void StopBuild() { if (Worker != null) { Worker.Abort(); Worker = null; if (buildHelper != null) { buildHelper.AbortProcess(); buildHelper = null; } foreach (var proj in projBuilds) { if (proj.Status == Project.BuildStatus.Progress) { proj.Status = Project.BuildStatus.Wait; } } OnBuildComplete(null); } }