public string[] GetBuildNames(string projectName) { // TODO - this is a hack - I'll tidy it up later - promise! :) MR foreach (IProjectIntegrator projectIntegrator in projectIntegrators) { if (projectIntegrator.Name == projectName) { foreach (ITask publisher in ((Project)projectIntegrator.Project).Publishers) { if (publisher is XmlLogPublisher) { string logDirectory = ((XmlLogPublisher)publisher).LogDirectory(projectIntegrator.Project.ArtifactDirectory); if (!Directory.Exists(logDirectory)) { Log.Warning("Log Directory [ " + logDirectory + " ] does not exist. Are you sure any builds have completed?"); return(new string[0]); } string[] logFileNames = LogFileUtil.GetLogFileNames(logDirectory); Array.Reverse(logFileNames); return(logFileNames); } } throw new CruiseControlException("Unable to find Log Publisher for project so can't find log file"); } } throw new NoSuchProjectException(projectName); }
public string[] GetBuildNames(string projectName) { string logDirectory = this.GetBuildLogDirectory(projectName); if (!Directory.Exists(logDirectory)) { Log.Warning("Log Directory [ " + logDirectory + " ] does not exist. Are you sure any builds have completed?"); return(new string[0]); } string[] logFileNames = LogFileUtil.GetLogFileNames(logDirectory); Array.Reverse(logFileNames); return(logFileNames); }