private Program(string root) { this.root = root; package = Path.GetFileName(root); versions = Directory.GetDirectories(root).Select(dir => Path.GetRelativePath(root, dir)).ToList(); var packageName = Path.GetFileName(root); Console.WriteLine("Loading docfx metadata"); releases = versions.Select(v => Release.Load(Path.Combine(root, v, "api"), v)).ToList(); Console.WriteLine("Loading assemblies"); reflectionDataByVersion = versions .ToDictionary(v => v, v => NuGetPackage.Load(Directory.GetFiles(Path.Combine(root, v), "*.nupkg").Single()).Assemblies); }
private static IEnumerable <BuildAssembly> LoadAssemblies(string version, string packagesDir, string srcRoot) { if (version == "unstable") { return(from package in packages from framework in unstableFrameworks let file = $"{package}.dll" select BuildAssembly.Load(framework, file, Path.Combine(srcRoot, package, "bin", "Debug", framework, file))); } else { return(packages .Select(p => Path.Combine(packagesDir, $"{p}-{version}.nupkg")) .Where(file => File.Exists(file)) .Select(file => NuGetPackage.Load(file)) .SelectMany(pkg => pkg.Assemblies)); } }