private void WriteFile(string outputLocation, string classText, ProjectSet ps, bool appendText = false)
 {
     _logger.WriteLine("Generating build file: " + outputLocation);
     if (ps != null)
     {
         ps.ProjectInfos.ForEach(pi =>
         {
             _logger.WriteLine("     " + pi.AssemblyName);
         });
     }
     using (StreamWriter sw = new StreamWriter(outputLocation, appendText))
     {
         sw.Write(classText);
     }
 }
        public BuildInfo GenerateBuild(List<ProjectInfo> pis, string buildFileRelativeOffset)
        {
            BuildInfo bi = new BuildInfo(buildFileRelativeOffset);
            List<ProjectInfo> accountedProjects = new List<ProjectInfo>();

            // First find projects with no references in anything else in this list.
            int counter = 0;
            ProjectSet lastPs = null;
            while (accountedProjects.Count != pis.Count)
            {
                var nextBatch = FindNextBatch(pis, accountedProjects);
                var newPs = new ProjectSet(nextBatch, string.Format("Batch {0}", counter++));
                if (lastPs != null)
                    newPs.DependsOn = lastPs;
                lastPs = newPs;
                bi.ProjectSetsToBuild.Add(newPs);
                accountedProjects.AddRange(nextBatch);

            }

            return bi;
        }
 public buildBatchTemplate(BuildInfo bi ,ProjectSet model)
 {
     BuildInfo = bi;
     CurrentProjectSet = model;
 }