703 references to FileUtilities
Microsoft.Build (270)
BackEnd\BuildManager\BuildManager.cs (5)
431FileUtilities.ClearTempFileDirectory(); 551_buildParameters.OutputResultsCacheFile = FileUtilities.NormalizePath("msbuild-cache"); 1468ErrorUtilities.VerifyThrow(FileUtilities.IsSolutionFilename(config.ProjectFullPath), "{0} is not a solution", config.ProjectFullPath); 2332if (FileUtilities.IsSolutionFilename(config.ProjectFullPath)) 2743FileUtilities.ClearFileExistenceCache();
BackEnd\BuildManager\BuildRequestData.cs (1)
145: this(targetsToBuild, hostServices, flags, FileUtilities.NormalizePath(projectFullPath)!)
BackEnd\BuildManager\CacheSerialization.cs (1)
31var fullPath = FileUtilities.NormalizePath(outputCacheFile);
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (3)
129_debugDumpPath = FileUtilities.TempFileDirectory; 1427FileUtilities.EnsureDirectoryExists(_debugDumpPath); 1429using (StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, @"EngineTrace_{0}.txt"), Process.GetCurrentProcess().Id), append: true))
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (2)
427if (s_pathToX64Clr2 == null || !FileUtilities.FileExistsNoThrow(Path.Combine(s_pathToX64Clr2, toolName))) 440if (s_pathToX32Clr2 == null || !FileUtilities.FileExistsNoThrow(Path.Combine(s_pathToX32Clr2, toolName)))
BackEnd\Components\FileAccesses\FileAccessManager.cs (2)
47_tempDirectory = FileUtilities.EnsureNoTrailingSlash(FileUtilities.TempFileDirectory);
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
181string pluginPath = FileUtilities.NormalizePath(Path.Combine(item.Project.Directory, item.EvaluatedInclude));
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (4)
317string projectPath = FileUtilities.AttemptToShortenPath(project.ItemSpec); 345if (FileUtilities.IsVCProjFilename(projectPath)) 553string projectPath = FileUtilities.AttemptToShortenPath(projects[i].ItemSpec); 706outputItemFromTarget.SetMetadata(ItemMetadataNames.msbuildSourceProjectFile, projects[i].GetMetadata(FileUtilities.ItemSpecModifiers.FullPath));
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
353projectFiles[i] = FileUtilities.NormalizePath(projectFiles[i]);
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (7)
981string oldestOutput = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(outputs[0].ToString())); 999string arbitraryInput = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(inputs[0].ToString())); 1007string candidateOutput = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(outputs[i].ToString())); 1025EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(inputs[0].ToString())); 1042string unescapedInput = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(input.ToString())); 1130input = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(input)); 1131output = EscapingUtilities.UnescapeAll(FileUtilities.FixFilePath(output));
BackEnd\Components\RequestBuilder\TaskBuilder.cs (4)
1030var declaredProjects = new HashSet<string>(projectReferenceItems.Count + 1, FileUtilities.PathComparer); 1034declaredProjects.Add(FileUtilities.NormalizePath(projectReferenceItem.EvaluatedInclude)); 1038declaredProjects.Add(FileUtilities.NormalizePath(_taskExecutionHost.ProjectInstance.FullPath)); 1044var normalizedMSBuildProject = FileUtilities.NormalizePath(msbuildProject.ItemSpec);
BackEnd\Components\Scheduler\Scheduler.cs (7)
227_debugDumpPath = FileUtilities.TempFileDirectory; 2570FileUtilities.EnsureDirectoryExists(_debugDumpPath); 2572using StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerTrace_{0}.txt"), Process.GetCurrentProcess().Id), append: true); 2595FileUtilities.EnsureDirectoryExists(_debugDumpPath); 2596using StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true); 2710using StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true); 2750using StreamWriter file = FileUtilities.OpenWrite(String.Format(CultureInfo.CurrentCulture, Path.Combine(_debugDumpPath, "SchedulerState_{0}.txt"), Process.GetCurrentProcess().Id), append: true);
BackEnd\Components\SdkResolution\DefaultSdkResolver.cs (1)
35return FileUtilities.DirectoryExistsNoThrow(sdkPath)
BackEnd\Components\SdkResolution\SdkResolverLoader.cs (5)
109if ((string.IsNullOrEmpty(rootFolder) || !FileUtilities.DirectoryExistsNoThrow(rootFolder)) && AdditionalResolversFolder == null) 141if (!string.IsNullOrEmpty(rootFolder) && FileUtilities.DirectoryExistsNoThrow(rootFolder)) 178if (!string.IsNullOrEmpty(pathToManifest) && !FileUtilities.FileExistsNoThrow(pathToManifest)) 203if (string.IsNullOrEmpty(manifest.Path) || !FileUtilities.FileExistsNoThrow(manifest.Path)) 215if (string.IsNullOrEmpty(assemblyPath) || !FileUtilities.FileExistsNoThrow(assemblyPath))
BackEnd\Components\SdkResolution\SdkResolverManifest.cs (1)
82manifest.Path = FileUtilities.FixFilePath(manifest.Path);
BackEnd\Node\OutOfProcServerNode.cs (1)
129FileUtilities.ClearCacheDirectory();
BackEnd\Shared\BuildRequestConfiguration.cs (5)
307else if (FileUtilities.IsMetaprojectFilename(ProjectFullPath)) 313else if (FileUtilities.IsSolutionFilename(ProjectFullPath)) 982string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, "Configuration{0}.cache", _configId)); 995FileUtilities.DeleteNoThrow(cacheFile); 1055if (FileUtilities.IsVCProjFilename(data.ProjectFullPath))
BackEnd\Shared\BuildResult.cs (1)
713FileUtilities.DeleteDirectoryNoThrow(resultsDirectory, true /*recursive*/);
BackEnd\Shared\ConfigurationMetadata.cs (3)
29_projectFullPath = FileUtilities.NormalizePath(configuration.ProjectFullPath); 46_projectFullPath = FileUtilities.NormalizePath(project.FullPath); 174var truncatedProjectFile = FileUtilities.TruncatePathToTrailingSegments(ProjectFullPath, 2);
BackEnd\Shared\TargetResult.cs (1)
215string filename = Path.Combine(FileUtilities.GetCacheDirectory(), String.Format(CultureInfo.InvariantCulture, Path.Combine("Results{0}", "{1}.cache"), configId, targetToCache));
BuildCheck\Checks\SharedOutputPathCheck.cs (1)
82path = FileUtilities.NormalizePath(path);
BuildCheck\Infrastructure\EditorConfig\EditorConfigParser.cs (2)
43var editorConfigFilePath = FileUtilities.GetPathOfFileAbove(EditorconfigFile, directoryOfTheProject); 66editorConfigFilePath = FileUtilities.GetPathOfFileAbove(EditorconfigFile, Path.GetDirectoryName(Path.GetDirectoryName(editorConfigFilePath)));
BuildEnvironmentHelper.cs (9)
150var vsRoot = FileUtilities.GetFolderAbove(vsProcess, 3); 202var msBuildExe = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.exe"); 203var msBuildDll = Path.Combine(FileUtilities.GetFolderAbove(buildAssembly), "MSBuild.dll"); 360return FileUtilities.GetFolderAbove(msBuildAssembly, 369return FileUtilities.CombinePaths( 445return FileUtilities.ExecutingAssemblyPath; 604var potentialAmd64FromX86 = FileUtilities.CombinePaths(MSBuildToolsDirectoryRoot, "amd64", msBuildExeName); 605var potentialARM64FromX86 = FileUtilities.CombinePaths(MSBuildToolsDirectoryRoot, "arm64", msBuildExeName); 677defaultSdkPath = FileUtilities.CombinePaths(VisualStudioInstallRootDirectory, "MSBuild", "Sdks");
CommunicationsUtilities.cs (2)
821s_debugDumpPath = FileUtilities.TempFileDirectory; 838using (StreamWriter file = FileUtilities.OpenWrite(
Construction\ProjectImportElement.cs (2)
55get => FileUtilities.FixFilePath(GetAttributeValue(XMakeAttributes.project)); 74get => FileUtilities.FixFilePath(GetAttributeValue(XMakeAttributes.sdk));
Construction\ProjectMetadataElement.cs (1)
106ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name);
Construction\ProjectRootElement.cs (7)
411string newFullPath = FileUtilities.NormalizePath(value); 859path = FileUtilities.NormalizePath(path); 916path = FileUtilities.NormalizePath(path); 1229ProjectUsingTaskElement usingTask = CreateUsingTaskElement(name, FileUtilities.FixFilePath(assemblyFile), assemblyName); 1537FileInfo fileInfo = FileUtilities.GetFileInfoNoThrow(_projectFileLocation.File); 2024if (FileUtilities.IsVCProjFilename(projectFile)) 2081_lastWriteTimeWhenReadUtc = FileUtilities.GetFileInfoNoThrow(fullPath).LastWriteTimeUtc;
Construction\ProjectUsingTaskElement.cs (3)
51get => FileUtilities.FixFilePath( 58value = FileUtilities.FixFilePath(value); 252usingTask.AssemblyFile = FileUtilities.FixFilePath(assemblyFile);
Construction\Solution\SolutionFile.cs (6)
196internal static bool ShouldUseNewParser(string solutionFile) => ChangeWaves.AreFeaturesEnabled(ChangeWaves.Wave17_14) || FileUtilities.IsSolutionXFilename(solutionFile); 273return _solutionFilter?.Contains(FileUtilities.FixFilePath(projectFile)) != false; 630_solutionFilter.Add(FileUtilities.FixFilePath(project.GetString())); 653return FileUtilities.GetFullPath(solution.GetProperty("path").GetString(), Path.GetDirectoryName(solutionFilterFile)); 889projectPaths.Add(FileUtilities.FixFilePath(project.RelativePath)); 898new BuildEventFileInfo(FileUtilities.GetFullPath(project, Path.GetDirectoryName(_solutionFile))),
Construction\Solution\SolutionProjectGenerator.cs (1)
1298baseName = FileUtilities.EnsureNoTrailingSlash(baseName);
DebugUtils.cs (5)
32string environmentDebugPath = FileUtilities.TrimAndStripAnyQuotes(Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH")); 37if (!string.IsNullOrWhiteSpace(debugDirectory) && FileUtilities.CanWriteToDirectory(debugDirectory)) 41else if (FileUtilities.CanWriteToDirectory(Directory.GetCurrentDirectory())) 47debugDirectory = Path.Combine(FileUtilities.TempFileDirectory, "MSBuild_Logs"); 59FileUtilities.EnsureDirectoryExists(debugDirectory);
Definition\BuiltInMetadata.cs (5)
27{ return FileUtilities.ItemSpecModifiers.All.Length; } 37{ return FileUtilities.ItemSpecModifiers.All; } 76Debug.Assert(FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name)); 79if (String.Equals(name, FileUtilities.ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase)) 85value = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, evaluatedIncludeEscaped, definingProjectEscaped, name, ref fullPath);
Definition\Project.cs (2)
59private static readonly char[] s_invalidGlobChars = FileUtilities.InvalidFileNameChars.Where(c => c != '*' && c != '?' && c != '/' && c != '\\' && c != ':').ToArray(); 1949projectFile = FileUtilities.NormalizePath(projectFile);
Definition\ProjectCollection.cs (2)
467var versionInfo = FileVersionInfo.GetVersionInfo(FileUtilities.ExecutingAssemblyPath); 1161fileName = FileUtilities.NormalizePath(fileName);
Definition\ProjectItem.cs (5)
306{ return Metadata.Count + FileUtilities.ItemSpecModifiers.All.Length; } 461if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name)) 586ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name); 644ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name); 860if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name))
Definition\ProjectItemDefinition.cs (1)
154ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "ItemSpecModifierCannotBeCustomMetadata", name);
Definition\Toolset.cs (1)
415if (FileUtilities.EndsWithSlash(toolsPathToUse))
Errors\InvalidProjectFileException.cs (1)
226string fullPath = FileUtilities.GetFullPathNoThrow(projectFile);
ErrorUtilities.cs (1)
543if (FileUtilities.PathIsInvalid(parameter))
Evaluation\Conditionals\FunctionCallExpressionNode.cs (3)
53if (item == null || !(state.LoadedProjectsCache?.TryGet(item) != null || FileUtilities.FileOrDirectoryExistsNoThrow(item, state.FileSystem))) 123argument = FileUtilities.FixFilePath(argument); 157argument = FileUtilities.FixFilePath(argument);
Evaluation\Conditionals\Scanner.cs (1)
477bool isItemSpecModifier = FileUtilities.ItemSpecModifiers.IsItemSpecModifier(expression);
Evaluation\Evaluator.cs (5)
848string pluginPath = FileUtilities.NormalizePath(_data.Directory, item.EvaluatedInclude); 1180string projectDirectoryNoRoot = FileUtilities.EnsureNoLeadingOrTrailingSlash(projectDirectory, rootLength); 2018FileUtilities.NormalizePath(EscapingUtilities.UnescapeAll(importExpressionEscapedItem)); 2073importFileUnescaped = FileUtilities.NormalizePath(importFileUnescaped); 2489relativeProjectPath = FileUtilities.MakeRelative(extensionsPathPropValue, importExpandedWithDefaultPath);
Evaluation\Expander.cs (20)
179_builder.Append(FileUtilities.MaybeAdjustFilePath(obj.ToString())); 196_builder.Append(FileUtilities.MaybeAdjustFilePath(span)); 218return (_firstObject is string stringValue) ? FileUtilities.MaybeAdjustFilePath(stringValue) : _firstObject; 222: FileUtilities.MaybeAdjustFilePath(_firstSpan).ToString(); 250_builder.Append(FileUtilities.MaybeAdjustFilePath(_firstObject.ToString())); 259_builder.Append(FileUtilities.MaybeAdjustFilePath(_firstSpan.ToString())); 501result = FileUtilities.MaybeAdjustFilePath(result); 569expression = FileUtilities.MaybeAdjustFilePath(expression); 1091bool isBuiltInMetadata = FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName); 1625value = FileUtilities.NormalizePath(elementLocation.File); 1633value = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(elementLocation.File)); 1639value = FileUtilities.EnsureTrailingNoLeadingSlash(directory, rootLength); 2260if (FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(functionName)) 2365string definingProjectEscaped = item.Value.GetMetadataValueEscaped(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 2367result = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(directoryToUse, item.Key, definingProjectEscaped, functionName); 2505rootedPath = FileUtilities.NormalizePath(rootedPath); 3060if (FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(name)) 3066string definingProjectEscaped = _sourceOfMetadata.GetMetadataValueEscaped(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 3068value = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(directoryToUse, _itemSpec, definingProjectEscaped, name); 3508argumentValue = FileUtilities.FixFilePath(argumentValue);
Evaluation\IntrinsicFunctions.cs (8)
336string result = FileUtilities.MakeRelative(basePath, path); 350return FileUtilities.GetDirectoryNameOfFileAbove(startingDirectory, fileName, fileSystem); 363return FileUtilities.GetPathOfFileAbove(file, startingDirectory, fileSystem); 495if (taskHostLocation != null && FileUtilities.FileExistsNoThrow(taskHostLocation)) 511return FileUtilities.EnsureTrailingSlash(path); 532return FileUtilities.NormalizePath(path); 642if (c >= 32 && c <= 126 && !FileUtilities.InvalidFileNameChars.Contains(c)) 698pathToAssembly = FileUtilities.GetFullPathNoThrow(pathToAssembly);
Evaluation\ItemSpec.cs (5)
350string key = FileUtilities.NormalizePathForComparisonNoThrow(spec, fragment.ProjectDirectory); 531&& FileUtilities.IsAnySlash(TextFragment[0]) 534&& FileUtilities.IsAnySlash(TextFragment[3]); 582options == MatchOnMetadataOptions.CaseInsensitive || FileUtilities.PathComparison == StringComparison.OrdinalIgnoreCase ? StringComparer.OrdinalIgnoreCase : 585_normalize = options == MatchOnMetadataOptions.PathLike ? (Func<string, string>)(p => FileUtilities.NormalizePathForComparisonNoThrow(p, Environment.CurrentDirectory)) : p => p;
Evaluation\LazyItemEvaluator.cs (3)
157normalizedItemValue = FileUtilities.NormalizePathForComparisonNoThrow(Item.EvaluatedInclude, Item.ProjectDirectory); 387string fullPath = FileUtilities.GetFullPath(frag.TextFragment, frag.ProjectDirectory); 443string fullPath = FileUtilities.NormalizePathForComparisonNoThrow(items[i].Item.EvaluatedInclude, items[i].Item.ProjectDirectory);
Evaluation\LazyItemEvaluator.LazyItemOperation.cs (2)
215itemContext.OperationItem.SetMetadata(metadataElement, FileUtilities.MaybeAdjustFilePath(evaluatedValue, metadataElement.ContainingProject.DirectoryPath)); 252evaluatedValue = FileUtilities.MaybeAdjustFilePath(evaluatedValue, metadataElement.ContainingProject.DirectoryPath);
Evaluation\ProjectParser.cs (2)
379if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name) || XMakeElements.ReservedItemNames.Contains(name)) 400ProjectErrorUtilities.VerifyThrowInvalidProject(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(element.Name), element.Location, "ItemSpecModifierCannotBeCustomMetadata", element.Name);
Evaluation\ProjectRootElementCache.cs (1)
184FileInfo fileInfo = FileUtilities.GetFileInfoNoThrow(projectFile);
ExceptionHandling.cs (3)
74: FileUtilities.TempFileDirectory; 359using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true)) 366using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true))
FileMatcher.cs (17)
39internal static readonly char[] directorySeparatorCharacters = FileUtilities.Slashes; 224path = FileUtilities.FixFilePath(path); 588filespec = FileUtilities.FixFilePath(filespec); 862Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1237bool isSurroundedBySlashes = (i == 0 || FileUtilities.IsAnySlash(str[i - 1])) 1238&& i < str.Length - 2 && FileUtilities.IsAnySlash(str[i + 2]); 1374else if (FileUtilities.IsAnySlash(ch)) 1419if (startIndex >= str.Length || !FileUtilities.IsAnySlash(str[startIndex])) 1428bool isSeparator = i < str.Length - 1 && FileUtilities.IsAnySlash(str[i + 1]); 1429bool isRelativeSeparator = i < str.Length - 2 && str[i + 1] == '.' && FileUtilities.IsAnySlash(str[i + 2]); 2127FileUtilities.IsAnySlash(wildcard[2]) && 2128FileUtilities.IsAnySlash(wildcard[wildcardLength - 3]) && 2133if (wildcard.IndexOfAny(FileUtilities.Slashes, 3, wildcardLength - 6) == -1) 2294if (!FileUtilities.IsAnySlash(directoryPart[i])) 2324while (index < aString.Length && FileUtilities.IsAnySlash(aString[index])) 2341if (FileUtilities.PathsEqual(filespecUnescaped, excludeSpec)) 2657int index = directoryPath.LastIndexOfAny(FileUtilities.Slashes);
FileUtilities.cs (1)
747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly));
FrameworkLocationHelper.cs (1)
1535this._pathToDotNetFrameworkReferenceAssemblies = FileUtilities.EnsureTrailingSlash(referencePath);
Globbing\MSBuildGlob.cs (5)
101if (FileUtilities.PathIsInvalid(stringToMatch)) 120if (FileUtilities.PathIsInvalid(stringToMatch) || !IsLegal) 144var normalizedInput = FileUtilities.GetFullPathNoThrow(rootedInput); 180globRoot = Strings.WeakIntern(FileUtilities.NormalizePath(globRoot).WithTrailingSlash()); 240var normalizedFixedPart = FileUtilities.GetFullPathNoThrow(parentedFixedPart);
Graph\GraphBuilder.cs (2)
249if (entryPoints.Count == 0 || !entryPoints.Any(e => FileUtilities.IsSolutionFilename(e.ProjectFile))) 579if (FileUtilities.IsSolutionFilename(referenceInfo.ReferenceConfiguration.ProjectFullPath))
Graph\ProjectGraphEntryPoint.cs (1)
34ProjectFile = FileUtilities.NormalizePath(projectFile);
Graph\ProjectGraphNode.cs (1)
53var truncatedProjectFile = FileUtilities.TruncatePathToTrailingSegments(ProjectInstance.FullPath, 2);
Instance\ProjectInstance.cs (4)
302projectFile = FileUtilities.NormalizePath(projectFile); 2544ErrorUtilities.VerifyThrow(FileUtilities.IsSolutionFilename(projectFile), "Project file {0} is not a solution.", projectFile); 2605if (FileUtilities.IsSolutionFilterFilename(projectFile)) 2648toolsVersionFromProject: FileUtilities.IsSolutionFilterFilename(projectFile) ? "Current" : toolsVersion,
Instance\ProjectItemInstance.cs (8)
839_includeEscaped = FileUtilities.FixFilePath(includeEscaped); 840_includeBeforeWildcardExpansionEscaped = FileUtilities.FixFilePath(includeBeforeWildcardExpansionEscaped); 947List<string> names = new List<string>(capacity: metadataCollection.Count + FileUtilities.ItemSpecModifiers.All.Length); 954names.AddRange(FileUtilities.ItemSpecModifiers.All); 1692FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name) || 1880if (!FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(name)) 1894.Where(item => !FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(item.Key)) 1930if (FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name))
Instance\ProjectMetadataInstance.cs (1)
72ErrorUtilities.VerifyThrowArgument(!XMakeElements.ReservedItemNames.Contains(name) && !FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name), "OM_ReservedName", name);
Instance\TaskRegistry.cs (7)
366assemblyFile = FileUtilities.FixFilePath(assemblyFile); 383!FileUtilities.FileExistsNoThrow(assemblyFile, fileSystem)) 387if (FileUtilities.FileExistsNoThrow(replacedAssemblyFile, fileSystem)) 401!FileUtilities.FileExistsNoThrow(s_potentialTasksV4Location, fileSystem) && 402FileUtilities.FileExistsNoThrow(s_potentialTasksCoreLocation, fileSystem)) 409!FileUtilities.FileExistsNoThrow(s_potentialTasksV12Location, fileSystem) && 410FileUtilities.FileExistsNoThrow(s_potentialTasksCoreLocation, fileSystem))
Logging\BinaryLogger\ProjectImportsCollector.cs (1)
66string cacheDirectory = FileUtilities.GetCacheDirectory();
Logging\FileLogger.cs (2)
118_fileWriter = FileUtilities.OpenWrite(_logFileName, _append, _encoding); 202_logFileName = FileUtilities.FixFilePath(parameterValue);
Logging\LoggerDescription.cs (1)
61loggerAssemblyFile = FileUtilities.NormalizePath(loggerAssemblyFile);
Modifiers.cs (31)
110if (name == FileUtilities.ItemSpecModifiers.RootDir) 126if (name == FileUtilities.ItemSpecModifiers.FullPath) 130if (name == FileUtilities.ItemSpecModifiers.Filename) 138if (name == FileUtilities.ItemSpecModifiers.Identity) 153if (name == FileUtilities.ItemSpecModifiers.Directory) 161if (name == FileUtilities.ItemSpecModifiers.Extension) 176if (name == FileUtilities.ItemSpecModifiers.CreatedTime) 184if (name == FileUtilities.ItemSpecModifiers.RelativeDir) 200if (name == FileUtilities.ItemSpecModifiers.AccessedTime) 208if (name == FileUtilities.ItemSpecModifiers.ModifiedTime) 216if (name == FileUtilities.ItemSpecModifiers.RecursiveDir) 256if (name == FileUtilities.ItemSpecModifiers.DefiningProjectName) 262if (name == FileUtilities.ItemSpecModifiers.DefiningProjectFullPath) 274if (name == FileUtilities.ItemSpecModifiers.DefiningProjectDirectory) 282if (name == FileUtilities.ItemSpecModifiers.DefiningProjectExtension) 392if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.FullPath, StringComparison.OrdinalIgnoreCase)) 409else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RootDir, StringComparison.OrdinalIgnoreCase)) 425else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Filename, StringComparison.OrdinalIgnoreCase)) 440else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Extension, StringComparison.OrdinalIgnoreCase)) 454else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RelativeDir, StringComparison.OrdinalIgnoreCase)) 458else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Directory, StringComparison.OrdinalIgnoreCase)) 495else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase)) 500else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.Identity, StringComparison.OrdinalIgnoreCase)) 504else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.ModifiedTime, StringComparison.OrdinalIgnoreCase)) 510FileInfo info = FileUtilities.GetFileInfoNoThrow(unescapedItemSpec); 522else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.CreatedTime, StringComparison.OrdinalIgnoreCase)) 538else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.AccessedTime, StringComparison.OrdinalIgnoreCase)) 563if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectDirectory, StringComparison.OrdinalIgnoreCase)) 574if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectFullPath, StringComparison.OrdinalIgnoreCase)) 578else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectName, StringComparison.OrdinalIgnoreCase)) 582else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectExtension, StringComparison.OrdinalIgnoreCase))
PrintLineDebuggerWriters.cs (1)
74var executingAssembly = FileUtilities.ExecutingAssemblyPath;
SolutionConfiguration.cs (1)
60projectAbsolutePath = FileUtilities.GetFullPathNoThrow(projectAbsolutePath);
TaskLoggingHelper.cs (1)
1328using (StreamReader fileStream = FileUtilities.OpenRead(fileName, Encoding.GetEncoding(0))) // HIGHCHAR: Use ANSI for logging messages.
TaskParameter.cs (10)
298escapedDefiningProject = copyFromAsITaskItem2.GetMetadataValueEscaped(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 319escapedDefiningProject = EscapingUtilities.EscapeWithCaching(copyFrom.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath)); 413escapedDefiningProject = wrappedItemAsITaskItem2.GetMetadataValueEscaped(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 422escapedDefiningProject = EscapingUtilities.EscapeWithCaching(wrappedItem.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath)); 794metadataNames.AddRange(FileUtilities.ItemSpecModifiers.All); 810return count + FileUtilities.ItemSpecModifiers.All.Length; 852ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName); 866ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName); 959if (FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName)) 963metadataValue = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(null, _escapedItemSpec, _escapedDefiningProject, metadataName, ref _fullPath);
TempFileUtilities.cs (1)
74return FileUtilities.EnsureTrailingSlash(basePath);
ToolsetElement.cs (1)
85string tempFileName = FileUtilities.GetTemporaryFile();
Utilities\FileSpecMatchTester.cs (6)
35_unescapedFileSpec = FileUtilities.NormalizePathForComparisonNoThrow(_unescapedFileSpec, _currentDirectory); 64fileToMatch = FileUtilities.NormalizePathForComparisonNoThrow(fileToMatch, _currentDirectory); 68fileToMatch = FileUtilities.GetFullPathNoThrow(Path.Combine(_currentDirectory, fileToMatch)); 113if (FileUtilities.PathIsInvalid(fixedDirPart)) 132: FileUtilities.GetFullPathNoThrow(absoluteFixedDirPart); 134normalizedFixedDirPart = FileUtilities.EnsureTrailingSlash(normalizedFixedDirPart);
Microsoft.Build.BuildCheck.UnitTests (1)
TestAssemblyInfo.cs (1)
76FileUtilities.ClearTempFileDirectory();
Microsoft.Build.Engine.UnitTests (415)
BackEnd\BuildManager_Tests.cs (3)
396FileUtilities.DeleteWithoutTrailingBackslash(shutdownProjectDirectory, true /* recursive delete */); 2339FileUtilities.ClearCacheDirectory(); 3507string cacheDirectory = FileUtilities.GetCacheDirectory();
BackEnd\BuildRequestConfiguration_Tests.cs (4)
478FileUtilities.ClearCacheDirectoryPath(); 479FileUtilities.ClearTempFileDirectory(); 487FileUtilities.ClearCacheDirectoryPath(); 488FileUtilities.ClearTempFileDirectory();
BackEnd\CacheSerialization_Tests.cs (2)
98cacheFile = FileUtilities.GetTemporaryFile("MSBuildResultsCache"); 130cacheFile = FileUtilities.GetTemporaryFile("MSBuildResultsCache");
BackEnd\IntrinsicTask_Tests.cs (5)
1855if (FileUtilities.GetIsFileSystemCaseSensitive()) 3341FileUtilities.DeleteWithoutTrailingBackslash(directoryForTest, true); 3372FileUtilities.DeleteWithoutTrailingBackslash(directoryForTest, true); 3385importedFile = FileUtilities.GetTemporaryFileName(); 3424importedFile = FileUtilities.GetTemporaryFileName();
BackEnd\LoggingServicesLogMethod_Tests.cs (1)
484FileUtilities.DeleteWithoutTrailingBackslash(testTempPath, true);
BackEnd\SdkResolverLoader_Tests.cs (4)
58var root = FileUtilities.GetTemporaryDirectory(); 85FileUtilities.DeleteDirectoryNoThrow(root, true); 92var root = FileUtilities.GetTemporaryDirectory(); 117FileUtilities.DeleteDirectoryNoThrow(root, true);
BackEnd\TargetBuilder_Tests.cs (1)
287string path = FileUtilities.GetTemporaryFile();
BackEnd\TargetEntry_Tests.cs (1)
864project.FullPath = FileUtilities.GetTemporaryFile();
BackEnd\TargetUpToDateChecker_Tests.cs (7)
885input1 = FileUtilities.GetTemporaryFileName(); 892input2 = FileUtilities.GetTemporaryFileName(); 899output1 = FileUtilities.GetTemporaryFileName(); 906output2 = FileUtilities.GetTemporaryFileName(); 1029inputTarget = FileUtilities.GetTemporaryFile(); 1033inputSymlink = FileUtilities.GetTemporaryFile(null, null, ".linkin", createFile: false); 1065outputTarget = FileUtilities.GetTemporaryFile();
BackEnd\TaskExecutionHost_Tests.cs (1)
1094FileUtilities.DeleteNoThrow(ExceptionHandling.DumpFilePath);
BinaryLogger_Tests.cs (2)
670FileUtilities.DeleteNoThrow(binaryLogger.FilePath); 691FileUtilities.DeleteNoThrow(binaryLogger.FilePath);
BuildEnvironmentHelper_Tests.cs (4)
27var msbuildPath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 492FileUtilities.DeleteDirectoryNoThrow(BuildDirectory, true); 536FileUtilities.DeleteDirectoryNoThrow(BuildDirectory, true); 563FileUtilities.DeleteDirectoryNoThrow(TempFolderRoot, true);
ConsoleLogger_Tests.cs (4)
382if (FileUtilities.DirectoryExistsNoThrow(tempProjectDir)) 384FileUtilities.DeleteDirectoryNoThrow(tempProjectDir, true); 398if (FileUtilities.DirectoryExistsNoThrow(tempProjectDir)) 400FileUtilities.DeleteDirectoryNoThrow(tempProjectDir, true);
Construction\ElementLocation_Tests.cs (3)
355doc.Save(FileUtilities.GetTemporaryFile()); 404using (XmlWriter wr = XmlWriter.Create(new FileStream(FileUtilities.GetTemporaryFileName(), FileMode.Create))) 422file = FileUtilities.GetTemporaryFileName();
Construction\SolutionFile_NewParser_Tests.cs (1)
138TransientTestFile sln = testEnvironment.CreateFile(FileUtilities.GetTemporaryFileName(".sln"), solutionFileContents);
Construction\SolutionFile_OldParser_Tests.cs (12)
170string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 221string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 222string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproja.proj"); 346string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 347string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 541string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 542string proj2Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj2.etp"); 543string proj3Path = Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest", "someproj3.etp"); 596Directory.CreateDirectory(Path.Combine(FileUtilities.TempFileDirectory, "ETPProjUpgradeTest")); 631string proj1Path = Path.Combine(FileUtilities.TempFileDirectory, "someproj.etp"); 773var solutionFolder = env.CreateFolder(Path.Combine(FileUtilities.GetTemporaryDirectory(), "sln")); 805sp.FullPath = FileUtilities.GetTemporaryFileName(".sln");
Construction\SolutionProjectGenerator_Tests.cs (7)
869""".Replace("##temp##", FileUtilities.TempFileDirectory); 1113string tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "ClassLibrary1", "ClassLibrary1.csproj"); 1120tempProjectPath = Path.Combine(FileUtilities.TempFileDirectory, "MainApp", "MainApp.vcxproj"); 1991string tmpFileName = FileUtilities.GetTemporaryFileName(); 2068string tmpFileName = FileUtilities.GetTemporaryFileName(); 2156string tmpFileName = FileUtilities.GetTemporaryFileName(); 2246string tmpFileName = FileUtilities.GetTemporaryFileName();
Definition\ItemDefinitionGroup_Tests.cs (5)
1216importedFile = FileUtilities.GetTemporaryFileName(); 1752otherProject = FileUtilities.GetTemporaryFileName(); 1767using (StreamWriter writer = FileUtilities.OpenWrite(otherProject, false)) 1809otherProject = FileUtilities.GetTemporaryFileName(); 1826using (StreamWriter writer = FileUtilities.OpenWrite(otherProject, false))
Definition\ToolsetConfigurationReaderTestHelper.cs (1)
53FileUtilities.DeleteDirectoryNoThrow(s_testFolderFullPath, true, 5, 1000);
EscapingInProjects_Tests.cs (4)
21using FileUtilities = Microsoft.Build.Shared.FileUtilities; 539inputFile = FileUtilities.GetTemporaryFile(); 540outputFile = FileUtilities.GetTemporaryFile(); 665FileUtilities.DeleteWithoutTrailingBackslash(path);
Evaluation\Evaluator_Tests.cs (41)
336FileUtilities.DeleteDirectoryNoThrow(targetDirectory, true); 465FileUtilities.DeleteDirectoryNoThrow(targetDirectory, true); 525FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 568FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 614FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 656FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 702FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 747FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 793FileUtilities.DeleteWithoutTrailingBackslash(targetDirectory, true); 810importPath = FileUtilities.GetTemporaryFileName(); 873importPath = FileUtilities.GetTemporaryFileName(); 874importPath2 = FileUtilities.GetTemporaryFileName(); 875importPath3 = FileUtilities.GetTemporaryFileName(); 975importPath1 = FileUtilities.GetTemporaryFileName(); 976importPath2 = FileUtilities.GetTemporaryFileName(); 1037importPath1 = FileUtilities.GetTemporaryFileName(); 1038importPath2 = FileUtilities.GetTemporaryFileName(); 1168FileUtilities.DeleteWithoutTrailingBackslash(directory2); 1169FileUtilities.DeleteWithoutTrailingBackslash(directory); 1827file = FileUtilities.GetTemporaryFileName(); 1976file = FileUtilities.GetTemporaryFileName(); 2061file = FileUtilities.GetTemporaryFileName(); 3393FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3418FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3454FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3479FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3514FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3539FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3586FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3615FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3659FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3688FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3724FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3749FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3786FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 3811FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 4371FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 4524FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 4550FileUtilities.DeleteWithoutTrailingBackslash(projectDirectory, true /* recursive delete */); 5195FileUtilities.DeleteWithoutTrailingBackslash(directory); 5238FileUtilities.DeleteWithoutTrailingBackslash(directory, true);
Evaluation\Expander_Tests.cs (6)
3384string tempPath = FileUtilities.TempFileDirectory; 3385string tempFile = Path.GetFileName(FileUtilities.GetTemporaryFile()); 3399Assert.Equal(Microsoft.Build.Shared.FileUtilities.EnsureTrailingSlash(tempPath), Microsoft.Build.Shared.FileUtilities.EnsureTrailingSlash(result)); 3422string fileToFind = FileUtilities.GetTemporaryFile(ObjectModelHelpers.TempProjectDir, null, ".tmp"); 3705string tempFile = FileUtilities.GetTemporaryFile();
Evaluation\ImportFromMSBuildExtensionsPath_Tests.cs (26)
68FileUtilities.DeleteNoThrow(mainProjectPath); 72FileUtilities.DeleteDirectoryNoThrow(extnDir1, recursive: true); 317FileUtilities.DeleteNoThrow(mainProjectPath); 321FileUtilities.DeleteDirectoryNoThrow(extnDir1, recursive: true); 424FileUtilities.DeleteNoThrow(mainProjectPath); 428FileUtilities.DeleteDirectoryNoThrow(extnDir1, recursive: true); 432FileUtilities.DeleteDirectoryNoThrow(extnDir2, recursive: true); 515FileUtilities.DeleteNoThrow(mainProjectPath); 519FileUtilities.DeleteDirectoryNoThrow(extnDir1, recursive: true); 523FileUtilities.DeleteDirectoryNoThrow(extnDir2, recursive: true); 527FileUtilities.DeleteDirectoryNoThrow(extnDir3, recursive: true); 588FileUtilities.DeleteNoThrow(mainProjectPath); 589FileUtilities.DeleteDirectoryNoThrow(extnDir1, true); 650FileUtilities.DeleteNoThrow(mainProjectPath); 651FileUtilities.DeleteDirectoryNoThrow(extnDir1, true); 719FileUtilities.DeleteNoThrow(mainProjectPath); 720FileUtilities.DeleteDirectoryNoThrow(extnDir1, true); 784FileUtilities.DeleteNoThrow(mainProjectPath); 785FileUtilities.DeleteDirectoryNoThrow(extnDir1, true); 843FileUtilities.DeleteNoThrow(mainProjectPath); 844FileUtilities.DeleteDirectoryNoThrow(extnDir1, true); 905FileUtilities.DeleteDirectoryNoThrow(extnDir1, recursive: true); 909FileUtilities.DeleteDirectoryNoThrow(extnDir2, recursive: true); 913FileUtilities.DeleteNoThrow(mainProjectPath); 936FileUtilities.DeleteNoThrow(mainProjectPath); 943FileUtilities.DeleteDirectoryNoThrow(extnDir, recursive: true);
Evaluation\Preprocessor_Tests.cs (1)
782FileUtilities.DeleteWithoutTrailingBackslash(directory);
Evaluation\ProjectRootElementCache_Tests.cs (2)
115path = FileUtilities.GetTemporaryFileName(); 149path = FileUtilities.GetTemporaryFileName();
ExpressionTree_Tests.cs (1)
106string fileThatMustAlwaysExist = FileUtilities.GetTemporaryFileName();
FileLogger_Tests.cs (11)
28string logFile = FileUtilities.GetTemporaryFile(); 60log = FileUtilities.GetTemporaryFileName(); 111log = FileUtilities.GetTemporaryFileName(); 192log = FileUtilities.GetTemporaryFileName(); 218log = FileUtilities.GetTemporaryFileName(); 245log = FileUtilities.GetTemporaryFileName(); 294log = FileUtilities.GetTemporaryFileName(); 318log = FileUtilities.GetTemporaryFileName(); 434using (StreamWriter sw = FileUtilities.OpenWrite(log, false)) 465using (StreamReader sr = FileUtilities.OpenRead(file)) 520FileUtilities.DeleteWithoutTrailingBackslash(Path.Combine(Directory.GetCurrentDirectory(), "tempura"));
FileMatcher_Tests.cs (8)
1851expectedFixedDirectoryPart = FileUtilities.FixFilePath(expectedFixedDirectoryPart); 1852expectedWildcardDirectoryPart = FileUtilities.FixFilePath(expectedWildcardDirectoryPart); 2073if (FileUtilities.PathsEqual(path, candidateDirectoryName)) 2277if (FileUtilities.EndsWithSlash(normalizedPath)) 2281else if (FileUtilities.IsSlash(normalizedCandidate[normalizedPath.Length])) 2486expectedFixedDirectoryPart = FileUtilities.FixFilePath(expectedFixedDirectoryPart); 2487expectedWildcardDirectoryPart = FileUtilities.FixFilePath(expectedWildcardDirectoryPart); 2488expectedFilenamePart = FileUtilities.FixFilePath(expectedFilenamePart);
FileUtilities_Tests.cs (227)
35string modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, "foo", String.Empty, FileUtilities.ItemSpecModifiers.RecursiveDir, ref cache); 39modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, "foo", String.Empty, FileUtilities.ItemSpecModifiers.ModifiedTime, ref cache); 43modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, @"foo\goo", String.Empty, FileUtilities.ItemSpecModifiers.RelativeDir, ref cache); 47modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, @"foo\goo", String.Empty, FileUtilities.ItemSpecModifiers.RelativeDir, ref cache); 53modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.FullPath, ref cache); 57modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.RootDir, ref cache); 60modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.Filename, ref cache); 63modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.Extension, ref cache); 66modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.Directory, ref cache); 69modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, String.Empty, FileUtilities.ItemSpecModifiers.Identity, ref cache); 74modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, projectPath, FileUtilities.ItemSpecModifiers.DefiningProjectDirectory, ref cache); 77modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, projectPath, FileUtilities.ItemSpecModifiers.DefiningProjectExtension, ref cache); 80modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, projectPath, FileUtilities.ItemSpecModifiers.DefiningProjectFullPath, ref cache); 83modifier = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, itemSpec, projectPath, FileUtilities.ItemSpecModifiers.DefiningProjectName, ref cache); 92Assert.Equal(@"foo.cpp", FileUtilities.MakeRelative(@"c:\abc\def", @"c:\abc\def\foo.cpp")); 93Assert.Equal(@"def\foo.cpp", FileUtilities.MakeRelative(@"c:\abc\", @"c:\abc\def\foo.cpp")); 94Assert.Equal(@"..\foo.cpp", FileUtilities.MakeRelative(@"c:\abc\def\xyz", @"c:\abc\def\foo.cpp")); 95Assert.Equal(@"..\ttt\foo.cpp", FileUtilities.MakeRelative(@"c:\abc\def\xyz\", @"c:\abc\def\ttt\foo.cpp")); 96Assert.Equal(@"e:\abc\def\foo.cpp", FileUtilities.MakeRelative(@"c:\abc\def", @"e:\abc\def\foo.cpp")); 97Assert.Equal(@"foo.cpp", FileUtilities.MakeRelative(@"\\aaa\abc\def", @"\\aaa\abc\def\foo.cpp")); 98Assert.Equal(@"foo.cpp", FileUtilities.MakeRelative(@"c:\abc\def", @"foo.cpp")); 99Assert.Equal(@"\\host\path\file", FileUtilities.MakeRelative(@"c:\abc\def", @"\\host\path\file")); 100Assert.Equal(@"\\host\d$\file", FileUtilities.MakeRelative(@"c:\abc\def", @"\\host\d$\file")); 101Assert.Equal(@"..\fff\ggg.hh", FileUtilities.MakeRelative(@"c:\foo\bar\..\abc\cde", @"c:\foo\bar\..\abc\fff\ggg.hh")); 104Assert.Equal(@"def\", FileUtilities.MakeRelative(@"c:\abc\", @"c:\abc\def\")); 105Assert.Equal(@"..\", FileUtilities.MakeRelative(@"c:\abc\def\xyz\", @"c:\abc\def\")); 106Assert.Equal(@"..\ttt\", FileUtilities.MakeRelative(@"c:\abc\def\xyz\", @"c:\abc\def\ttt\")); 107Assert.Equal(@".", FileUtilities.MakeRelative(@"c:\abc\def\", @"c:\abc\def\")); 110Assert.Equal(@"def", FileUtilities.MakeRelative(@"c:\abc\", @"c:\abc\def")); 111Assert.Equal(@"..\..\ghi", FileUtilities.MakeRelative(@"c:\abc\def\xyz\", @"c:\abc\ghi")); 112Assert.Equal(@"..\ghi", FileUtilities.MakeRelative(@"c:\abc\def\xyz\", @"c:\abc\def\ghi")); 113Assert.Equal(@"..\ghi", FileUtilities.MakeRelative(@"c:\abc\def\", @"c:\abc\ghi")); 116Assert.Equal(@"def\", FileUtilities.MakeRelative(@"c:\abc", @"c:\abc\def\")); 117Assert.Equal(@"..\", FileUtilities.MakeRelative(@"c:\abc\def\xyz", @"c:\abc\def\")); 118Assert.Equal(@"..\ghi\", FileUtilities.MakeRelative(@"c:\abc\def\xyz", @"c:\abc\def\ghi\")); 119Assert.Equal(@".", FileUtilities.MakeRelative(@"c:\abc\def", @"c:\abc\def\")); 123Assert.Equal(@"bar.cpp", FileUtilities.MakeRelative(@"/abc/def", @"/abc/def/bar.cpp")); 124Assert.Equal(@"def/foo.cpp", FileUtilities.MakeRelative(@"/abc/", @"/abc/def/foo.cpp")); 125Assert.Equal(@"../foo.cpp", FileUtilities.MakeRelative(@"/abc/def/xyz", @"/abc/def/foo.cpp")); 126Assert.Equal(@"../ttt/foo.cpp", FileUtilities.MakeRelative(@"/abc/def/xyz/", @"/abc/def/ttt/foo.cpp")); 127Assert.Equal(@"foo.cpp", FileUtilities.MakeRelative(@"/abc/def", @"foo.cpp")); 128Assert.Equal(@"../fff/ggg.hh", FileUtilities.MakeRelative(@"/foo/bar/../abc/cde", @"/foo/bar/../abc/fff/ggg.hh")); 131Assert.Equal(@"def/", FileUtilities.MakeRelative(@"/abc/", @"/abc/def/")); 132Assert.Equal(@"../", FileUtilities.MakeRelative(@"/abc/def/xyz/", @"/abc/def/")); 133Assert.Equal(@"../ttt/", FileUtilities.MakeRelative(@"/abc/def/xyz/", @"/abc/def/ttt/")); 134Assert.Equal(@".", FileUtilities.MakeRelative(@"/abc/def/", @"/abc/def/")); 137Assert.Equal(@"def", FileUtilities.MakeRelative(@"/abc/", @"/abc/def")); 138Assert.Equal(@"../../ghi", FileUtilities.MakeRelative(@"/abc/def/xyz/", @"/abc/ghi")); 139Assert.Equal(@"../ghi", FileUtilities.MakeRelative(@"/abc/def/xyz/", @"/abc/def/ghi")); 140Assert.Equal(@"../ghi", FileUtilities.MakeRelative(@"/abc/def/", @"/abc/ghi")); 143Assert.Equal(@"def/", FileUtilities.MakeRelative(@"/abc", @"/abc/def/")); 144Assert.Equal(@"../", FileUtilities.MakeRelative(@"/abc/def/xyz", @"/abc/def/")); 145Assert.Equal(@"../ghi/", FileUtilities.MakeRelative(@"/abc/def/xyz", @"/abc/def/ghi/")); 146Assert.Equal(@".", FileUtilities.MakeRelative(@"/abc/def", @"/abc/def/")); 178FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, @"http://www.microsoft.com", String.Empty, FileUtilities.ItemSpecModifiers.RootDir, ref cache); 194file = FileUtilities.GetTemporaryFile(); 195FileInfo info = FileUtilities.GetFileInfoNoThrow(file); 210FileInfo info = FileUtilities.GetFileInfoNoThrow("this_file_is_nonexistent"); 222Assert.True(FileUtilities.EndsWithSlash(@"C:\foo\")); 223Assert.True(FileUtilities.EndsWithSlash(@"C:\")); 224Assert.True(FileUtilities.EndsWithSlash(@"\")); 226Assert.True(FileUtilities.EndsWithSlash(@"http://www.microsoft.com/")); 227Assert.True(FileUtilities.EndsWithSlash(@"//server/share/")); 228Assert.True(FileUtilities.EndsWithSlash(@"/")); 230Assert.False(FileUtilities.EndsWithSlash(@"C:\foo")); 231Assert.False(FileUtilities.EndsWithSlash(@"C:")); 232Assert.False(FileUtilities.EndsWithSlash(@"foo")); 235Assert.False(FileUtilities.EndsWithSlash(String.Empty)); 246Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\" : "/")); 247Assert.Equal(NativeMethodsShared.IsWindows ? @"c:\" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:\foo" : "/foo")); 248Assert.Equal(NativeMethodsShared.IsWindows ? @"c:" : "/", FileUtilities.GetDirectory(NativeMethodsShared.IsWindows ? @"c:" : "/")); 249Assert.Equal(FileUtilities.FixFilePath(@"\"), FileUtilities.GetDirectory(@"\")); 250Assert.Equal(FileUtilities.FixFilePath(@"\"), FileUtilities.GetDirectory(@"\foo")); 251Assert.Equal(FileUtilities.FixFilePath(@"..\"), FileUtilities.GetDirectory(@"..\foo")); 252Assert.Equal(FileUtilities.FixFilePath(@"\foo\"), FileUtilities.GetDirectory(@"\foo\")); 253Assert.Equal(FileUtilities.FixFilePath(@"\\server\share"), FileUtilities.GetDirectory(@"\\server\share")); 254Assert.Equal(FileUtilities.FixFilePath(@"\\server\share\"), FileUtilities.GetDirectory(@"\\server\share\")); 255Assert.Equal(FileUtilities.FixFilePath(@"\\server\share\"), FileUtilities.GetDirectory(@"\\server\share\file")); 256Assert.Equal(FileUtilities.FixFilePath(@"\\server\share\directory\"), FileUtilities.GetDirectory(@"\\server\share\directory\")); 257Assert.Equal(FileUtilities.FixFilePath(@"foo\"), FileUtilities.GetDirectory(@"foo\bar")); 258Assert.Equal(FileUtilities.FixFilePath(@"\foo\bar\"), FileUtilities.GetDirectory(@"\foo\bar\")); 259Assert.Equal(String.Empty, FileUtilities.GetDirectory("foo")); 268var result = FileUtilities.HasExtension(fileName, allowedExtensions); 270if (!FileUtilities.GetIsFileSystemCaseSensitive() || allowedExtensions.Any(extension => fileName.Contains(extension))) 286var result = FileUtilities.HasExtension(fileName, allowedExtensions); 296FileUtilities.HasExtension("|/", new[] { ".exe" }); 308var result = FileUtilities.HasExtension("foo.ini", new string[] { ".INI" }); 310result.ShouldBe(!FileUtilities.GetIsFileSystemCaseSensitive()); 325Assert.Equal(FileUtilities.FixFilePath(@"foo\bar\"), FileUtilities.EnsureTrailingSlash(@"foo\bar")); // "test 1" 326Assert.Equal(FileUtilities.FixFilePath(@"foo/bar\"), FileUtilities.EnsureTrailingSlash(@"foo/bar")); // "test 2" 329Assert.Equal(FileUtilities.FixFilePath(@"foo/bar/"), FileUtilities.EnsureTrailingSlash(@"foo/bar/")); // test 3" 330Assert.Equal(FileUtilities.FixFilePath(@"foo\bar\"), FileUtilities.EnsureTrailingSlash(@"foo\bar\")); // test 4" 331Assert.Equal(FileUtilities.FixFilePath(@"foo/bar\"), FileUtilities.EnsureTrailingSlash(@"foo/bar\")); // test 5" 332Assert.Equal(FileUtilities.FixFilePath(@"foo\bar/"), FileUtilities.EnsureTrailingSlash(@"foo\bar/")); // "test 5" 342Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("FullPath")); // "test 1" 343Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("RootDir")); // "test 2" 344Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Filename")); // "test 3" 345Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Extension")); // "test 4" 346Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("RelativeDir")); // "test 5" 347Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Directory")); // "test 6" 348Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("RecursiveDir")); // "test 7" 349Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Identity")); // "test 8" 350Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("ModifiedTime")); // "test 9" 351Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("CreatedTime")); // "test 10" 352Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("AccessedTime")); // "test 11" 355Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("fullPath")); // "test 21" 356Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("rootDir")); // "test 22" 357Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("filename")); // "test 23" 358Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("extension")); // "test 24" 359Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("relativeDir")); // "test 25" 360Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("directory")); // "test 26" 361Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("recursiveDir")); // "test 27" 362Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("identity")); // "test 28" 363Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("modifiedTime")); // "test 29" 364Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("createdTime")); // "test 30" 365Assert.True(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("accessedTime")); // "test 31" 369Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("rootxxx")); // "test 41" 370Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Rootxxx")); // "test 42" 371Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxx")); // "test 43" 373Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("filexxxx")); // "test 44" 374Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Filexxxx")); // "test 45" 375Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("idenxxxx")); // "test 46" 376Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Idenxxxx")); // "test 47" 377Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxxx")); // "test 48" 379Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("extenxxxx")); // "test 49" 380Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Extenxxxx")); // "test 50" 381Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("direcxxxx")); // "test 51" 382Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Direcxxxx")); // "test 52" 383Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxxxx")); // "test 53" 385Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxxxxx")); // "test 54" 387Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("relativexxx")); // "test 55" 388Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Relativexxx")); // "test 56" 389Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("createdxxxx")); // "test 57" 390Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Createdxxxx")); // "test 58" 391Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxxxxxx")); // "test 59" 393Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("recursivexxx")); // "test 60" 394Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Recursivexxx")); // "test 61" 395Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("accessedxxxx")); // "test 62" 396Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Accessedxxxx")); // "test 63" 397Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("modifiedxxxx")); // "test 64" 398Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("Modifiedxxxx")); // "test 65" 399Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier("xxxxxxxxxxxx")); // "test 66" 401Assert.False(FileUtilities.ItemSpecModifiers.IsItemSpecModifier(null)); // "test 67" 407Assert.True(FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier("Filename")); 408Assert.False(FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier("RecursiveDir")); 409Assert.False(FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier("recursivedir")); 419Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 433Assert.Equal(fullPath, FileUtilities.NormalizePath(Path.Combine(currentDirectory, filePath))); 444Assert.Equal(@"c:\", FileUtilities.ItemSpecModifiers.GetItemSpecModifier(currentDirectory, fullPath, String.Empty, FileUtilities.ItemSpecModifiers.RootDir, ref cache)); 452Assert.Null(FileUtilities.NormalizePath(null, null)); 461Assert.Null(FileUtilities.NormalizePath(String.Empty)); 470Assert.Null(FileUtilities.NormalizePath(@"\\")); 479Assert.Null(FileUtilities.NormalizePath(@"\\XXX\")); 488Assert.Equal(@"\\localhost", FileUtilities.NormalizePath(@"\\localhost")); 495Assert.Equal(@"\\localhost\share", FileUtilities.NormalizePath(@"\\localhost\share")); 502Assert.Equal(@"c:\abc\def", FileUtilities.NormalizePath(@"c:\abc\" + longPart + @"\..\def")); 531FileUtilities.NormalizePath(filePath); 543Assert.NotEqual("C:\\work\\sdk3\\artifacts\\tmp\\Debug\\SimpleNamesWi---6143883E\\NETFrameworkLibrary\\bin\\Debug\\net462\\NETFrameworkLibrary.dll", FileUtilities.NormalizePath(filePath)); 552Assert.False(FileUtilities.FileOrDirectoryExistsNoThrow("||")); 553Assert.False(FileUtilities.FileOrDirectoryExistsNoThrow(isWindows ? @"c:\doesnot_exist" : "/doesnot_exist")); 554Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(isWindows ? @"c:\" : "/")); 555Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(Path.GetTempPath())); 561path = FileUtilities.GetTemporaryFile(); 562Assert.True(FileUtilities.FileOrDirectoryExistsNoThrow(path)); 772path = FileUtilities.GetTemporaryFile(); 794path = FileUtilities.GetTemporaryFile(".bat"); 817path = FileUtilities.GetTemporaryFile(directory, null, ".bat"); 826FileUtilities.DeleteWithoutTrailingBackslash(directory); 840path = FileUtilities.GetTemporaryFile("bat"); 862FileUtilities.GetTemporaryFile("|"); 876FileUtilities.GetTemporaryFile("|", null, ".tmp"); 886Assert.True(FileUtilities.LooksLikeUnixFilePath(SystemSpecificAbsolutePath)); 887Assert.True(FileUtilities.LooksLikeUnixFilePath(rootLevelPath)); 893Assert.False(FileUtilities.LooksLikeUnixFilePath(SystemSpecificAbsolutePath)); 894Assert.False(FileUtilities.LooksLikeUnixFilePath("/path/that/looks/unixy")); 895Assert.False(FileUtilities.LooksLikeUnixFilePath("/root")); 913Assert.False(FileUtilities.LooksLikeUnixFilePath("second/file.txt")); 916Assert.True(FileUtilities.LooksLikeUnixFilePath("second/file.txt", firstDirectory)); 944Assert.Equal("second\\file.txt", FileUtilities.MaybeAdjustFilePath("second\\file.txt")); 947Assert.Equal("second/file.txt", FileUtilities.MaybeAdjustFilePath("second\\file.txt", firstDirectory)); 959private static string SystemSpecificAbsolutePath => FileUtilities.ExecutingAssemblyPath; 968Assert.Equal(Path.Combine(root, "1", "2", "3", "4", "5"), FileUtilities.GetFolderAbove(path, 0)); 969Assert.Equal(Path.Combine(root, "1", "2", "3", "4"), FileUtilities.GetFolderAbove(path)); 970Assert.Equal(Path.Combine(root, "1", "2", "3"), FileUtilities.GetFolderAbove(path, 2)); 971Assert.Equal(Path.Combine(root, "1", "2"), FileUtilities.GetFolderAbove(path, 3)); 972Assert.Equal(Path.Combine(root, "1"), FileUtilities.GetFolderAbove(path, 4)); 973Assert.Equal(root, FileUtilities.GetFolderAbove(path, 5)); 974Assert.Equal(root, FileUtilities.GetFolderAbove(path, 99)); 976Assert.Equal(root, FileUtilities.GetFolderAbove(root, 99)); 987FileUtilities.CombinePaths(root, "path1")); 991FileUtilities.CombinePaths(root, "path1", "path2", "file.txt")); 1019FileUtilities.ContainsRelativePathSegments(path).ShouldBe(expectedResult); 1034FileUtilities.TruncatePathToTrailingSegments(path, trailingSegments).ShouldBe(expectedTruncatedPath); 1054FileUtilities.EnsureSingleQuotes(path).ShouldBe(expectedResult); 1074FileUtilities.EnsureDoubleQuotes(path).ShouldBe(expectedResult);
Globbing\MSBuildGlob_Tests.cs (5)
73foreach (var invalidPathChar in FileUtilities.InvalidPathChars) 185foreach (var invalidPathChar in FileUtilities.InvalidPathChars) 190foreach (var invalidFileChar in FileUtilities.InvalidFileNameChars) 356var rootedFixedDirectoryPart = Path.Combine(FileUtilities.NormalizePath(globRoot), fixedDirectoryPart); 358Assert.Equal(FileUtilities.GetFullPathNoThrow(rootedFixedDirectoryPart), result.FixedDirectoryPartMatchGroup);
Instance\TaskItem_Tests.cs (2)
64Assert.Equal(item.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath), deserializedItem.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath));
TestAssemblyInfo.cs (1)
76FileUtilities.ClearTempFileDirectory();
TestComparers\TaskItemComparer.cs (4)
53if (!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName) || 54FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName)) 65if (!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName) || 66FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName))
TypeLoader_Dependencies_Tests.cs (3)
25using (var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder)) 43using (var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder)) 68var temporaryDirectory = FileUtilities.GetTemporaryDirectory();
TypeLoader_Tests.cs (5)
65using var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder); 82using (var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder)) 121using (var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder)) 146using (var dir = new FileUtilities.TempWorkingDirectory(ProjectFileFolder)) 173var temporaryDirectory = FileUtilities.GetTemporaryDirectory();
Microsoft.Build.Framework.UnitTests (1)
TestAssemblyInfo.cs (1)
76FileUtilities.ClearTempFileDirectory();
Microsoft.Build.UnitTests.Shared (16)
EngineTestEnvironment.cs (1)
232FileUtilities.DeleteNoThrow(binaryLoggerFilePath);
ObjectModelHelpers.cs (2)
656string projectFilePath = FileUtilities.GetTemporaryFile(); 1074files[i] = FileUtilities.GetTemporaryFile();
RequiresSymbolicLinksFactAttribute.cs (2)
29string sourceFile = FileUtilities.GetTemporaryFile(); 30string destinationFile = FileUtilities.GetTemporaryFileName();
RunnerUtilities.cs (1)
49msbuildParameters = FileUtilities.EnsureDoubleQuotes(pathToMsBuildExe) + " " + msbuildParameters;
TestEnvironment.cs (10)
475string debugPath = FileUtilities.TempFileDirectory; 510FileUtilities.DeleteNoThrow(file.FullName); 618FileUtilities.DeleteDirectoryNoThrow(TempPath, recursive: true); 661Environment.SetEnvironmentVariable("MSBUILDDEBUGPATH", FileUtilities.TempFileDirectory); 686Path = FileUtilities.GetTemporaryFile(null, null, extension, createFile); 693Path = FileUtilities.GetTemporaryFile(rootPath, null, extension, createFile); 716FileUtilities.DeleteNoThrow(Path); 730Path = folderPath ?? FileUtilities.GetTemporaryDirectory(createFolder, subfolder); 760FileUtilities.DeleteDirectoryNoThrow(Path, true); 823FileUtilities.DeleteNoThrow(Path);