public static Build Read(Stream stream, byte[] projectImportsArchive = null) { using (var binaryLogReader = new BinaryLogReader(stream)) { if (!binaryLogReader.formatIsValid) { throw new Exception("Invalid log file format"); } var build = (Build)binaryLogReader.ReadNode(); var buildStringCache = build.StringTable; foreach (var stringInstance in binaryLogReader.reader.StringTable) { buildStringCache.Intern(stringInstance); } if (build.SourceFilesArchive == null && projectImportsArchive != null) { build.SourceFilesArchive = projectImportsArchive; } return(build); } }
public static Build Read(string filePath) { using (var binaryLogReader = new BinaryLogReader(filePath)) { if (!binaryLogReader.formatIsValid) { throw new Exception("Invalid log file format"); } var build = (Build)binaryLogReader.ReadNode(); var buildStringCache = build.StringTable; foreach (var stringInstance in binaryLogReader.reader.StringTable) { buildStringCache.Intern(stringInstance); } var projectImportsZip = Path.ChangeExtension(filePath, ".ProjectImports.zip"); if (build.SourceFilesArchive == null && File.Exists(projectImportsZip)) { build.SourceFilesArchive = File.ReadAllBytes(projectImportsZip); } return(build); } }
public static Build Read(string filePath) { using (var binaryLogReader = new BinaryLogReader(filePath)) { var build = (Build)binaryLogReader.ReadNode(); var buildStringCache = build.StringTable; foreach (var stringInstance in binaryLogReader.reader.StringTable) { buildStringCache.Intern(stringInstance); } return(build); } }