public void IngoresDirectoryPatternsInOptions() { _options.AddIgnoreDirectoryPatterns("Folder1", "Folder2"); _finder.Expect(f => f.IgnorePatterns("Folder1", "Folder2")); _finder.Expect(f => f.FindAllProjectFiles(WorkingDirectory)).Return(new List <FileInfo>()); _repository.LookupCsProjsFromDirectory(_options); }
public void IngoresDirectoryPatternsInOptions() { options.AddIgnoreDirectoryPatterns("Folder1", "Folder2"); finder.Expect(f => f.IgnorePatterns(new[] { "Folder1", "Folder2" })); finder.Expect(f => f.FindAllProjectFiles(StartPath)).Return(new List <FileInfo>()); repository.LookupCsProjsFromDirectory(options); }
private void ProcessArguments(string[] args) { optionSet = new OptionSet { { "t|target=", "{NAME} of a target project (repeat for multiple targets)", v => options.TargetProjectNames.Add(v) }, { "r|root=", "{PATH} to the root directory where your projects reside (optional, defaults to working directory)", v => options.ProjectsRootDirectory = v }, { "l|narrow=", "limit search process to {PATH}(s) in the root directory (optional, repeat for multiple paths)", v => options.AddRootFolderSearchPaths(v) }, { "s|search=", "additional {PATH}(s) to search for projects to include outside of the root directory (repeat for multiple paths)", v => options.AddAdditionalSearchPaths(v) }, { "i|ignore=", "ignore directories whose name matches the given {REGEX_PATTERN} (repeat for multiple ignores)", v => options.AddIgnoreDirectoryPatterns(v) }, { "o|out=", "directory {PATH} where you want the .sln file written", v => options.SlnOutputPath = v }, { "version=", "Visual Studio {VERSION} compatibility (2008, 2010, 2012, 2013, 2015, 2017, 2019, default)", v => options.VisualStudioVersion = TryParseVersionNumber(v) }, { "p|projecttype=", "Project file {TYPE} ('.csproj', '.vbproj', '.vcxproj', default)", v => options.AddProjectFileTypes(TryParseProjectType(v)) }, { "n|name=", "alternate {NAME} for solution file", v => options.SolutionName = v }, { "m|minimal", "skip all afferent assembly references (included by default)", v => options.SkipAfferentAssemblyReferences = true }, { "a|all", "include all efferent assembly references (omitted by default)", v => options.IncludeEfferentAssemblyReferences = true }, { "h|help", "display the help screen", v => options.ShowHelp = true }, { "c|convert", "convert assembly references in csproj files to project references", v => options.ConvertReferences = true }, { "u|unconvert", "unconvert (restore) assembly references that were previously converted", v => options.RestoreReferences = true }, { "H|fixhintpaths", "convert hint paths in csproj files to point to nuget packages folder relative to generated sln", v => options.FixHintPaths = true }, { "U|restorehintpaths", "unconvert hint paths in csproj files to point to their original nuget packages folder", v => options.RestoreHintPaths = true }, { "open", "open the solution in Visual Studio", v => options.OpenInVisualStudio = true }, { "debug", "attach debugger", v => Debugger.Launch() }, { "q|quiet", "reduce logging verbosity (can specify multiple times)", v => options.LoggingThreshold = options.LoggingThreshold.DecreaseVerbosity() }, { "v|verbose", "increase logging verbosity (can specify multiple times)", v => options.LoggingThreshold = options.LoggingThreshold.IncreaseVerbosity() } }; try { optionSet.Parse(args); } catch (OptionException optEx) { if (ParseError != null) { ParseError(optEx.Message); } } }
public void IngoresDirectoryPatternsInOptions() { options.AddIgnoreDirectoryPatterns("Folder1", "Folder2"); finder.Expect(f => f.IgnorePatterns(new[] { "Folder1", "Folder2" })); if (options.ProjectTypes.Length > 0) { finder.SetProjectTypes(options.ProjectTypes); } finder.Expect(f => f.FindAllProjectFiles(WorkingDirectory)).Return(new List <FileInfo>()); repository.LookupCsProjsFromDirectory(options); }
private void ProcessArguments(string[] args) { optionSet = new OptionSet { { "t|target=", "{NAME} of a target project (repeat for multiple targets)", v => options.TargetProjectNames.Add(v) }, { "r|root=", "{PATH} to the root directory where your projects reside (optional, defaults to working directory)", v => options.ProjectsRootDirectory = v }, { "s|search=", "additional {PATH}(s) to search for projects to include outside of the root directory (repeat for multiple paths)", v => options.AddAdditionalSearchPaths(v) }, { "o|out=", "directory {PATH} where you want the .sln file written", v => options.SlnOutputPath = v }, { "v|version=", "Visual Studio {VERSION} compatibility (2008, 2010 default)", v => options.VisualStudioVersion = TryParseVersionNumber(v) }, { "n|name=", "alternate {NAME} for solution file", v => options.SolutionName = v }, { "a|all", "include all efferent assembly references (omitted by default)", v => options.IncludeEfferentAssemblyReferences = true }, { "h|help", "display the help screen", v => options.ShowHelp = true }, { "i|ignore=", "ignore directories whose name matches the given {REGEX_PATTERN} (repeat for multiple ignores)", v => options.AddIgnoreDirectoryPatterns(v) }, { "c|convert", "convert assembly references in csproj files to project references", v => options.ConvertReferences = true }, { "u|unconvert", "unconvert (restore) assembly references that were previously converted", v => options.RestoreReferences = true }, { "open", "open the solution in Visual Studio", v => options.OpenInVisualStudio = true }, { "debug", "attach debugger", v => Debugger.Launch() }, { "q|quiet", "reduce logging verbosity to errors only", v => options.LoggingThreshold = Level.Error }, { "verbose", "increase logging verbosity to include debug messages", v => options.LoggingThreshold = Level.Debug } }; try { optionSet.Parse(args); } catch (OptionException optEx) { if (ParseError != null) { ParseError(optEx.Message); } } }
private void ProcessArguments(string[] args) { optionSet = new OptionSet { { "t|target=", "{NAME} of a target project (repeat for multiple targets)", v => { FileAttributes fileAttributes = File.GetAttributes(v); if ((fileAttributes & FileAttributes.Directory) == 0) { options.TargetProjectNames.Add(v); options.BaseFolder = Path.GetDirectoryName(v); } else { options.BaseFolder = v; options.TargetProjectNames.AddRange( Directory.EnumerateFiles(v, "*.*", SearchOption.AllDirectories) .Where(s => s.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase) || s.EndsWith(".jsproj", StringComparison.OrdinalIgnoreCase) || s.EndsWith(".njsproj", StringComparison.OrdinalIgnoreCase))); } } }, { "tp|toolPath=", "Path to the tool that should be opened with the open option", v => options.ToolPath = v }, { "r|root=", "{PATH} to the root directory where your projects reside (optional, defaults to working directory)", v => options.ProjectsRootDirectory = v }, { "s|search=", "additional {PATH}(s) to search for projects to include outside of the root directory (repeat for multiple paths)", v => options.AddAdditionalSearchPaths(v) }, { "o|out=", "directory {PATH} where you want the .sln file written", v => options.SlnOutputPath = v }, { "version=", "Visual Studio {VERSION} compatibility (2008, 2010, 2012, 2013, 2015 default)", v => options.VisualStudioVersion = TryParseVersionNumber(v) }, { "n|name=", "alternate {NAME} for solution file", v => options.SolutionName = v }, { "m|minimal", "skip all afferent assembly references (included by default)", v => options.SkipReferences = true }, { "a|all", "include all efferent assembly references (omitted by default)", v => options.IncludeReferencing = true }, { "h|help", "display the help screen", v => options.ShowHelp = true }, { "rel|relative", "Used to indicate relative paths should be used in the soluton file.", v => options.UseRelativePaths = true }, { "i|ignore=", "ignore directories whose name matches the given {REGEX_PATTERN} (repeat for multiple ignores)", v => options.AddIgnoreDirectoryPatterns(v) }, { "c|convert", "convert assembly references in csproj files to project references", v => options.ConvertReferences = true }, { "u|unconvert", "unconvert (restore) assembly references that were previously converted", v => options.RestoreReferences = true }, { "H|fixhintpaths", "convert hint paths in csproj files to point to nuget packages folder relative to generated sln", v => options.FixHintPaths = true }, { "U|restorehintpaths", "unconvert hint paths in csproj files to point to their original nuget packages folder", v => options.RestoreHintPaths = true }, { "open", "open the solution in Visual Studio", v => options.OpenInVisualStudio = true }, { "debug", "attach debugger", v => Debugger.Launch() }, { "q|quiet", "reduce logging verbosity (can specify multiple times)", v => options.LoggingThreshold = options.LoggingThreshold.DecreaseVerbosity() }, { "v|verbose", "increase logging verbosity (can specify multiple times)", v => options.LoggingThreshold = options.LoggingThreshold.IncreaseVerbosity() } }; try { optionSet.Parse(args); } catch (OptionException optEx) { if (ParseError != null) { ParseError(optEx.Message); } } }