101 references to FileUtilities
Microsoft.Build.CommandLine.UnitTests (9)
CommandLineSwitches_Tests.cs (1)
1155filename = FileUtilities.GetTemporaryFileName();
TestAssemblyInfo.cs (1)
76FileUtilities.ClearTempFileDirectory();
XMake_Tests.cs (7)
543FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe), 587FileUtilities.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe), 1070FileUtilities.DeleteWithoutTrailingBackslash(path, true /*and files*/); 1105using (StreamWriter sw = FileUtilities.OpenWrite(projectFileName, false)) 1143using (StreamWriter sw = FileUtilities.OpenWrite(projectFileName, false)) 1962if (FileUtilities.IsSolutionFilename(file)) 2786FileUtilities.CopyDirectory(directory, destSubDir);
MSBuild (92)
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(
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);
ErrorUtilities.cs (1)
543if (FileUtilities.PathIsInvalid(parameter))
ExceptionHandling.cs (3)
74: FileUtilities.TempFileDirectory; 359using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true)) 366using (StreamWriter writer = FileUtilities.OpenWrite(s_dumpFileName, append: true))
FileUtilities.cs (1)
747internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(FileUtilities).GetTypeInfo().Assembly));
JsonOutputFormatter.cs (1)
104foreach (string metadatumName in FileUtilities.ItemSpecModifiers.All)
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))
OutOfProcTaskHostNode.cs (1)
814? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(FileUtilities.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), Process.GetCurrentProcess().Id))
PrintLineDebuggerWriters.cs (1)
74var executingAssembly = FileUtilities.ExecutingAssemblyPath;
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);
TerminalLogger\TerminalLogger.cs (1)
654if (outputPathSpan.StartsWith(_initialWorkingDirectory.AsSpan(), FileUtilities.PathComparison))
XMake.cs (25)
159s_exePath = Path.GetDirectoryName(FileUtilities.ExecutingAssemblyPath); 329FileUtilities.IsBinaryLogFilename(projectFile) || 798if (cpuCount == 1 && FileUtilities.IsSolutionFilename(projectFile) && verbosity > LoggerVerbosity.Minimal 820if (FileUtilities.IsBinaryLogFilename(projectFile)) 824else if (outputPropertiesItemsOrTargetResults && FileUtilities.IsSolutionFilename(projectFile)) 1304if (FileUtilities.IsVCProjFilename(projectFile) || FileUtilities.IsDspFilename(projectFile)) 1401bool isSolution = FileUtilities.IsSolutionFilename(projectFile); 1695FileUtilities.ClearCacheDirectory(); 1984s_exeName = FileUtilities.FixFilePath(QuotingUtilities.Unquote(commandLineArgs[0])); 2049if (!ValidateSwitchIndicatorInUnquotedArgument(unquotedCommandLineArg) || FileUtilities.LooksLikeUnixFilePath(unquotedCommandLineArg)) 2205string responseFile = FileUtilities.FixFilePath(unquotedCommandLineArg.Substring(1)); 2235var responseFileDirectory = FileUtilities.EnsureTrailingSlash(Path.GetDirectoryName(responseFile)); 3031var projectFile = FileUtilities.FixFilePath(projectSwitchParameters[0]); 3062string directoryResponseFile = FileUtilities.GetPathOfFileAbove(directoryResponseFileName, projectDirectory); 3223writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3242writer = FileUtilities.OpenWrite(parameters[parameters.Length - 1], append: false); 3413FileUtilities.ClearCacheDirectory(); 3451FileUtilities.ClearCacheDirectory(); 3521projectFile = FileUtilities.FixFilePath(parameters[0]); 3565if (FileUtilities.IsSolutionFilterFilename(s)) 3569else if (FileUtilities.IsSolutionFilename(s)) 4095string logFileName = FileUtilities.FixFilePath(ExtractAnyParameterValue(logFileParameter)); 4359string testFile = FileUtilities.FixFilePath(loggerAssemblySpec); 4517string fileName = FileUtilities.FixFilePath(parameter);