public IEnumerable <string> TryGetSourcePaths(string sourcePath) { if (!File.Exists(sourcePath)) { return(null); } var isProject = ProjectFileUtility.IsPathProject(sourcePath); return(isProject ? new[] { sourcePath } : null); }
public IEnumerable <string> GetProjectCleanupPaths(PathInfo sourcePath) { var directoryPath = sourcePath.IsFile ? Path.GetDirectoryName(sourcePath.Value) : sourcePath.Value; var projectPaths = ProjectFileUtility.IsPathProject(sourcePath.Value) ? ProjectFileParser.GetProjectFilePaths(sourcePath.Value) : Enumerable.Empty <string>(); foreach (var projectPath in projectPaths) { yield return(Path.Combine(directoryPath, projectPath)); } foreach (var cleanPath in _context.CleanPaths) { yield return(Path.Combine(directoryPath, cleanPath)); } }