public void Prepare(CancellationToken token) { Debug.Assert(this.SolutionFullPath != null, "Expected to be initialized"); foreach (var keyValue in this.bindingConfigInformationMap) { if (token.IsCancellationRequested) { return; } var info = keyValue.Value; sourceControlledFileSystem.QueueFileWrites(info.SolutionLevelFilePaths, () => { foreach (var solutionItem in info.SolutionLevelFilePaths) { var ruleSetDirectoryPath = Path.GetDirectoryName(solutionItem); fileSystem.Directory.CreateDirectory(ruleSetDirectoryPath); // will no-op if exists } info.Save(); return(true); }); Debug.Assert(sourceControlledFileSystem.FilesExistOrQueuedToBeWritten(info.SolutionLevelFilePaths), "Expected solution items to be queued for writing"); } foreach (var project in projects) { if (token.IsCancellationRequested) { return; } var languageForProject = ProjectToLanguageMapper.GetLanguageForProject(project); var bindingConfigFile = GetBindingConfig(languageForProject); var projectBinder = projectBinderFactory.Get(project); var bindAction = projectBinder.GetBindAction(bindingConfigFile, project, token); projectBinders.Add(bindAction); } }
/// <summary> /// Returns whether the file exists on disk or in a queue to be written. <seealso cref="QueueFileWrite(ISourceControlledFileSystem,string,Func{bool})"/> /// </summary> public static bool FileExistOrQueuedToBeWritten(this ISourceControlledFileSystem sourceControlledFile, string filePath) { return(sourceControlledFile.FilesExistOrQueuedToBeWritten(new List <string> { filePath })); }