private static void ScanDir(IAbsoluteDirectoryPath dir, List <IAbsoluteFilePath> assembliesPath, IDotNetManager dotNetManager, int cursorTop) { Debug.Assert(dir != null); Debug.Assert(dir.Exists); Debug.Assert(assembliesPath != null); Debug.Assert(dotNetManager != null); Console.CursorTop = cursorTop; Console.CursorLeft = 0; Console.WriteLine(assembliesPath.Count + " assemblies found"); Console.Write("Scanning {" + dir.ToString() + "} "); foreach (var filePath in dir.ChildrenFilesPath) { if (!dotNetManager.IsAssembly(filePath)) { continue; } assembliesPath.Add(filePath); } ConsoleUtils.ShowNLinesOnConsole(Console.CursorTop - cursorTop + 1, ConsoleColor.Black); }
private static void ScanDir(IAbsoluteDirectoryPath dir, List <IAbsoluteFilePath> projectsPath, IDotNetManager dotNetManager, int cursorTop) { Debug.Assert(dir != null); Debug.Assert(dir.Exists); Debug.Assert(projectsPath != null); Debug.Assert(dotNetManager != null); Console.CursorTop = cursorTop; Console.CursorLeft = 0; Console.WriteLine(projectsPath.Count + " projects found"); Console.Write("Scanning {" + dir.ToString() + "} "); foreach (var filePath in dir.ChildrenFilesPath) { if (filePath.FileExtension == ".vcproj" || filePath.FileExtension == ".vcproj" || filePath.FileExtension == ".vcxproj" || filePath.FileExtension == ".sln" || filePath.FileExtension == ".build" || filePath.FileExtension == ".buildspec" || filePath.FileExtension == ".goannaspec" || filePath.FileExtension == ".sl" || filePath.FileExtension == ".proj") { projectsPath.Add(filePath); } } ConsoleUtils.ShowNLinesOnConsole(Console.CursorTop - cursorTop + 1, ConsoleColor.Black); }
private static void ScanDirRecursive(IAbsoluteDirectoryPath dir, List <IAbsoluteFilePath> assembliesPath, IDotNetManager dotNetManager, int cursorTop) { Debug.Assert(dir != null); Debug.Assert(dir.Exists); Debug.Assert(assembliesPath != null); Debug.Assert(dotNetManager != null); ScanDir(dir, assembliesPath, dotNetManager, cursorTop); foreach (var dirChild in dir.ChildrenDirectoriesPath) { ScanDirRecursive(dirChild, assembliesPath, dotNetManager, cursorTop); } }
private static ICollection <IAbsoluteFilePath> GetCoreAssembliesPath(Version version, IDotNetManager dotNetManager) { Debug.Assert(version != null); Debug.Assert(dotNetManager != null); var list = new List <IAbsoluteFilePath>(); var dirs = dotNetManager.GetDotNetProfileDirectories(DotNetProfile.DotNetFramework, version); list.AddRange( dirs.SelectMany(dir => new[] { "mscorlib.dll", "System.dll", "System.Core.dll", "System.Xml.dll" }, (dir, assemblyFileName) => dir.GetChildFileWithName(assemblyFileName)) .Where(assemblyPath => assemblyPath.Exists)); Debug.Assert(list.Count == 4); return(list); }