private static void Main(CommandLineArguments args) { var cache = new MetadataPackageCache(Path.GetFullPath(ConfigurationManager.AppSettings["NuGetPackagesPath"])); var sources = new IFeatureTableSource[] { new GeneralInfoTableSource(cache), new NetFxSupportTableSource(cache), new FeatureTestTableSource(new FeatureTestRunner()) }; var outputs = new IResultOutput[] { new HtmlOutput(new DirectoryInfo(ConfigurationManager.AppSettings["HtmlTemplatesPath"])), new JsonOutput() }; var outputDirectory = new DirectoryInfo(args.OutputPath ?? ConfigurationManager.AppSettings["OutputPath"]); if (!outputDirectory.Exists) { outputDirectory.Create(); } var assemblyPaths = GetAssemblyPaths(args); var results = assemblyPaths.Select(path => { ConsoleEx.Write(ConsoleColor.White, "Running " + Path.GetFileName(path) + ":"); var assembly = Assembly.LoadFrom(path); var tables = sources.SelectMany(s => s.GetTables(assembly)).ToArray(); CalculateTotal(tables.Single(t => t.Key == MetadataKeys.GeneralInfoTable), tables); var outputNamePrefix = assembly.GetName().Name.SubstringAfter(AssemblyNamePrefix); var result = new ResultForAssembly(assembly, tables, outputNamePrefix); ConsoleEx.WriteLine(ConsoleColor.Green, " OK"); return(result); }).ToArray(); Console.WriteLine(); ConsoleEx.WriteLine(ConsoleColor.White, "Creating outputs:"); foreach (var output in outputs) { output.Write(outputDirectory, results, args.WatchTemplates); } if (args.WatchTemplates) { Console.WriteLine(); ConsoleEx.WriteLine(ConsoleColor.White, "Auto-updating outputs if templates change."); ConsoleEx.WriteLine(ConsoleColor.White, "Press [Enter] to stop."); Console.ReadLine(); } foreach (var output in outputs) { output.Dispose(); } Console.WriteLine(); ConsoleEx.WriteLine(ConsoleColor.Green, "Completed."); }
public GeneralInfoTableSource(MetadataPackageCache packageCache) { this.packageCache = packageCache; }
public NetFxSupportTableSource(MetadataPackageCache packageCache) { this.packageCache = packageCache; }