Example #1
0
        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(BuildLogReader.Read(filePath));
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            else if (filePath.EndsWith(".buildlog", StringComparison.OrdinalIgnoreCase))
            {
                try
                {
                    return(BuildLogReader.Read(filePath));
                }
                catch (Exception)
                {
                    if (DetectLogFormat(filePath) == ".binlog")
                    {
                        return(BinaryLog.ReadBuild(filePath));
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            return(null);
        }
Example #2
0
 public static Build ReadBuildLog(Stream stream, byte[] projectImportsArchive = null) => BuildLogReader.Read(stream, projectImportsArchive);