public string WriteSolution(IFileSystem fs, string script, IVisualStudioSolution solution, IList <ProjectItem> nestedItems = null) { if (nestedItems == null) { nestedItems = new List <ProjectItem>(); } var launcher = Path.Combine(fs.TempPath, "launcher-" + Guid.NewGuid().ToString() + ".sln"); if (fs.FileExists(launcher)) { fs.FileDelete(launcher); } var currentDir = fs.CurrentDirectory; var scriptcsPath = Path.Combine(fs.HostBin, "scriptcs.exe"); var scriptcsArgs = string.Format("{0} -debug -loglevel info", script); Root = new DirectoryInfo { Name = "Solution Items", FullPath = currentDir }; var projectGuid = Guid.NewGuid(); solution.AddScriptcsProject(scriptcsPath, currentDir, scriptcsArgs, false, projectGuid); GetDirectoryInfo(fs, currentDir, Root); AddDirectoryProject(solution, fs, Root, _nullGuid, nestedItems); solution.AddGlobal(projectGuid, nestedItems); fs.WriteToFile(launcher, solution.ToString()); return(launcher); }
public string WriteSolution(IFileSystem fs, string script, IVisualStudioSolution solution, IList<ProjectItem> nestedItems = null) { if (nestedItems == null) { nestedItems = new List<ProjectItem>(); } var launcher = Path.Combine(fs.TempPath, "launcher-" + Guid.NewGuid().ToString() + ".sln"); if (fs.FileExists(launcher)) { fs.FileDelete(launcher); } var currentDir = fs.CurrentDirectory; var scriptcsPath = Path.Combine(fs.HostBin, "scriptcs.exe"); var scriptcsArgs = string.Format("{0} -debug -loglevel info", script); _root = new DirectoryInfo { Name = "Solution Items", FullPath = currentDir}; var projectGuid = Guid.NewGuid(); solution.AddScriptcsProject(scriptcsPath, currentDir, scriptcsArgs, false, projectGuid); GetDirectoryInfo(fs, currentDir, _root); AddDirectoryProject(solution, fs, _root, _nullGuid, nestedItems); solution.AddGlobal(projectGuid, nestedItems); fs.WriteToFile(launcher, solution.ToString()); return launcher; }
private void AddDirectoryProject(IVisualStudioSolution solution, IFileSystem fs, DirectoryInfo currentDirectory, Guid parent, IList <ProjectItem> nestedItems) { solution.AddProject(currentDirectory.FullPath, currentDirectory.Name, currentDirectory.Guid, currentDirectory.Files.ToArray()); foreach (DirectoryInfo dir in currentDirectory.Directories.Values) { AddDirectoryProject(solution, fs, dir, currentDirectory.Guid, nestedItems); } if (parent != _nullGuid) { nestedItems.Add(new ProjectItem(currentDirectory.Guid, parent)); } }
private void AddDirectoryProject(IVisualStudioSolution solution, IFileSystem fs, DirectoryInfo currentDirectory, Guid parent, IList<ProjectItem> nestedItems) { solution.AddProject(currentDirectory.FullPath, currentDirectory.Name, currentDirectory.Guid, currentDirectory.Files.ToArray()); foreach (DirectoryInfo dir in currentDirectory.Directories.Values) { AddDirectoryProject(solution, fs, dir, currentDirectory.Guid, nestedItems); } if (parent != _nullGuid) { nestedItems.Add(new ProjectItem(currentDirectory.Guid, parent)); } }
private void RunTests(IVisualStudioSolution sln, string testSuffix) { NUnit.Test(sln.Projects.Where(p => p.Name.EndsWith("."+ testSuffix)).Select(p => p.OutputFile)); }
private void RunTests(IVisualStudioSolution sln, string testSuffix) { NUnit.Test(sln.Projects.Where(p => p.Name.EndsWith("." + testSuffix)).Select(p => p.OutputFile)); }