public DiffedCompareSet[] Diff(CompareSet[] compareSets) { var engine = new ComparerEngine(); return ( from set in compareSets.OrderByDescending(cs => cs.Name) let diff = engine.CreateDiff(set.LeftAssemblyGroup, set.RightAssemblyGroup) select new DiffedCompareSet { Set = set, Diff = diff } ).ToArray(); }
static bool Compare(CompareSet compareSet, bool showAllVersions = true, bool nonInteractive = false, string reportPath = null) { var engine = new ComparerEngine(); var diff = engine.CreateDiff(compareSet.LeftAssemblyGroup, compareSet.RightAssemblyGroup); var breakingChanges = BreakingChangeFinder.Find(diff) .ToList(); var hasBreakingChange = breakingChanges.Any(); if (!showAllVersions && !hasBreakingChange) { return(true); } Console.Out.Write("Checking {0}", compareSet); if (hasBreakingChange) { Console.Out.WriteLine(": {0} Breaking Changes found", breakingChanges.Count); } else { Console.Out.WriteLine(": No breaking changes found"); } var resultFile = reportPath ?? Path.Combine(Path.GetTempPath(), Guid.NewGuid() + ".md"); using (var fileStream = File.OpenWrite(resultFile)) using (var into = new StreamWriter(fileStream)) { var formatter = new APIUpgradeToMarkdownFormatter(); formatter.WriteOut(ApiChanges.FromDiff(diff), @into); @into.Flush(); @into.Close(); fileStream.Close(); } Console.Out.WriteLine(resultFile); if (!nonInteractive) { Process.Start(resultFile); } return(!hasBreakingChange); }