public static Build Read(string filePath) { if (filePath.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) { return(XmlLogReader.ReadFromXml(filePath)); } else if (filePath.EndsWith(".binlog", StringComparison.OrdinalIgnoreCase)) { return(BinaryLog.ReadBuild(filePath)); } else if (filePath.EndsWith(".buildlog", StringComparison.OrdinalIgnoreCase)) { return(BinaryLogReader.Read(filePath)); } return(null); }
public static Build Read(string filePath) { if (filePath.EndsWith(".xml", StringComparison.OrdinalIgnoreCase)) { return(XmlLogReader.ReadFromXml(filePath)); } else if (filePath.EndsWith(".binlog", StringComparison.OrdinalIgnoreCase)) { try { return(BinaryLog.ReadBuild(filePath)); } catch (Exception) { if (DetectLogFormat(filePath) == ".buildlog") { return(BinaryLogReader.Read(filePath)); } else { throw; } } } else if (filePath.EndsWith(".buildlog", StringComparison.OrdinalIgnoreCase)) { try { return(BinaryLogReader.Read(filePath)); } catch (Exception) { if (DetectLogFormat(filePath) == ".binlog") { return(BinaryLog.ReadBuild(filePath)); } else { throw; } } } return(null); }
public static Build ReadBinLog(Stream stream, byte[] projectImportsArchive = null) => BinaryLog.ReadBuild(stream, projectImportsArchive).Result;