103 references to FileUtilities
Microsoft.Build.CommandLine.UnitTests (9)
CommandLineSwitches_Tests.cs (1)
1155
filename =
FileUtilities
.GetTemporaryFileName();
TestAssemblyInfo.cs (1)
76
FileUtilities
.ClearTempFileDirectory();
XMake_Tests.cs (7)
543
FileUtilities
.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
587
FileUtilities
.EnsureDoubleQuotes(RunnerUtilities.PathToCurrentlyRunningMsBuildExe),
1070
FileUtilities
.DeleteWithoutTrailingBackslash(path, true /*and files*/);
1105
using (StreamWriter sw =
FileUtilities
.OpenWrite(projectFileName, false))
1143
using (StreamWriter sw =
FileUtilities
.OpenWrite(projectFileName, false))
1962
if (
FileUtilities
.IsSolutionFilename(file))
2786
FileUtilities
.CopyDirectory(directory, destSubDir);
MSBuild (94)
BuildEnvironmentHelper.cs (9)
150
var vsRoot =
FileUtilities
.GetFolderAbove(vsProcess, 3);
202
var msBuildExe = Path.Combine(
FileUtilities
.GetFolderAbove(buildAssembly), "MSBuild.exe");
203
var msBuildDll = Path.Combine(
FileUtilities
.GetFolderAbove(buildAssembly), "MSBuild.dll");
360
return
FileUtilities
.GetFolderAbove(msBuildAssembly,
369
return
FileUtilities
.CombinePaths(
445
return
FileUtilities
.ExecutingAssemblyPath;
604
var potentialAmd64FromX86 =
FileUtilities
.CombinePaths(MSBuildToolsDirectoryRoot, "amd64", msBuildExeName);
605
var potentialARM64FromX86 =
FileUtilities
.CombinePaths(MSBuildToolsDirectoryRoot, "arm64", msBuildExeName);
677
defaultSdkPath =
FileUtilities
.CombinePaths(VisualStudioInstallRootDirectory, "MSBuild", "Sdks");
CommunicationsUtilities.cs (2)
821
s_debugDumpPath =
FileUtilities
.TempFileDirectory;
838
using (StreamWriter file =
FileUtilities
.OpenWrite(
CoreCLRAssemblyLoader.cs (1)
56
fullPath =
FileUtilities
.NormalizePath(fullPath);
DebugUtils.cs (5)
32
string environmentDebugPath =
FileUtilities
.TrimAndStripAnyQuotes(Environment.GetEnvironmentVariable("MSBUILDDEBUGPATH"));
37
if (!string.IsNullOrWhiteSpace(debugDirectory) &&
FileUtilities
.CanWriteToDirectory(debugDirectory))
41
else if (
FileUtilities
.CanWriteToDirectory(Directory.GetCurrentDirectory()))
47
debugDirectory = Path.Combine(
FileUtilities
.TempFileDirectory, "MSBuild_Logs");
59
FileUtilities
.EnsureDirectoryExists(debugDirectory);
ErrorUtilities.cs (1)
543
if (
FileUtilities
.PathIsInvalid(parameter))
ExceptionHandling.cs (3)
74
:
FileUtilities
.TempFileDirectory;
359
using (StreamWriter writer =
FileUtilities
.OpenWrite(s_dumpFileName, append: true))
366
using (StreamWriter writer =
FileUtilities
.OpenWrite(s_dumpFileName, append: true))
FileUtilities.cs (1)
747
internal static string ExecutingAssemblyPath => Path.GetFullPath(AssemblyUtilities.GetAssemblyLocation(typeof(
FileUtilities
).GetTypeInfo().Assembly));
JsonOutputFormatter.cs (1)
104
foreach (string metadatumName in
FileUtilities
.ItemSpecModifiers.All)
Modifiers.cs (31)
110
if (name ==
FileUtilities
.ItemSpecModifiers.RootDir)
126
if (name ==
FileUtilities
.ItemSpecModifiers.FullPath)
130
if (name ==
FileUtilities
.ItemSpecModifiers.Filename)
138
if (name ==
FileUtilities
.ItemSpecModifiers.Identity)
153
if (name ==
FileUtilities
.ItemSpecModifiers.Directory)
161
if (name ==
FileUtilities
.ItemSpecModifiers.Extension)
176
if (name ==
FileUtilities
.ItemSpecModifiers.CreatedTime)
184
if (name ==
FileUtilities
.ItemSpecModifiers.RelativeDir)
200
if (name ==
FileUtilities
.ItemSpecModifiers.AccessedTime)
208
if (name ==
FileUtilities
.ItemSpecModifiers.ModifiedTime)
216
if (name ==
FileUtilities
.ItemSpecModifiers.RecursiveDir)
256
if (name ==
FileUtilities
.ItemSpecModifiers.DefiningProjectName)
262
if (name ==
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath)
274
if (name ==
FileUtilities
.ItemSpecModifiers.DefiningProjectDirectory)
282
if (name ==
FileUtilities
.ItemSpecModifiers.DefiningProjectExtension)
392
if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.FullPath, StringComparison.OrdinalIgnoreCase))
409
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.RootDir, StringComparison.OrdinalIgnoreCase))
425
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.Filename, StringComparison.OrdinalIgnoreCase))
440
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.Extension, StringComparison.OrdinalIgnoreCase))
454
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.RelativeDir, StringComparison.OrdinalIgnoreCase))
458
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.Directory, StringComparison.OrdinalIgnoreCase))
495
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase))
500
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.Identity, StringComparison.OrdinalIgnoreCase))
504
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.ModifiedTime, StringComparison.OrdinalIgnoreCase))
510
FileInfo info =
FileUtilities
.GetFileInfoNoThrow(unescapedItemSpec);
522
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.CreatedTime, StringComparison.OrdinalIgnoreCase))
538
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.AccessedTime, StringComparison.OrdinalIgnoreCase))
563
if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.DefiningProjectDirectory, StringComparison.OrdinalIgnoreCase))
574
if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath, StringComparison.OrdinalIgnoreCase))
578
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.DefiningProjectName, StringComparison.OrdinalIgnoreCase))
582
else if (string.Equals(modifier,
FileUtilities
.ItemSpecModifiers.DefiningProjectExtension, StringComparison.OrdinalIgnoreCase))
MSBuildClientApp.cs (1)
108
string dotnetExe = Path.Combine(
FileUtilities
.GetFolderAbove(BuildEnvironmentHelper.Instance.CurrentMSBuildToolsDirectory, 2),
OutOfProcTaskHostNode.cs (1)
814
? File.CreateText(string.Format(CultureInfo.CurrentCulture, Path.Combine(
FileUtilities
.TempFileDirectory, @"MSBuild_NodeShutdown_{0}.txt"), Process.GetCurrentProcess().Id))
PrintLineDebuggerWriters.cs (1)
74
var executingAssembly =
FileUtilities
.ExecutingAssemblyPath;
TaskParameter.cs (10)
298
escapedDefiningProject = copyFromAsITaskItem2.GetMetadataValueEscaped(
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath);
319
escapedDefiningProject = EscapingUtilities.EscapeWithCaching(copyFrom.GetMetadata(
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath));
413
escapedDefiningProject = wrappedItemAsITaskItem2.GetMetadataValueEscaped(
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath);
422
escapedDefiningProject = EscapingUtilities.EscapeWithCaching(wrappedItem.GetMetadata(
FileUtilities
.ItemSpecModifiers.DefiningProjectFullPath));
794
metadataNames.AddRange(
FileUtilities
.ItemSpecModifiers.All);
810
return count +
FileUtilities
.ItemSpecModifiers.All.Length;
852
ErrorUtilities.VerifyThrowArgument(!
FileUtilities
.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName);
866
ErrorUtilities.VerifyThrowArgument(!
FileUtilities
.ItemSpecModifiers.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName);
959
if (
FileUtilities
.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName))
963
metadataValue =
FileUtilities
.ItemSpecModifiers.GetItemSpecModifier(null, _escapedItemSpec, _escapedDefiningProject, metadataName, ref _fullPath);
TempFileUtilities.cs (1)
74
return
FileUtilities
.EnsureTrailingSlash(basePath);
TerminalLogger\TerminalLogger.cs (1)
654
if (outputPathSpan.StartsWith(_initialWorkingDirectory.AsSpan(),
FileUtilities
.PathComparison))
XMake.cs (25)
159
s_exePath = Path.GetDirectoryName(
FileUtilities
.ExecutingAssemblyPath);
329
FileUtilities
.IsBinaryLogFilename(projectFile) ||
798
if (cpuCount == 1 &&
FileUtilities
.IsSolutionFilename(projectFile) && verbosity > LoggerVerbosity.Minimal
820
if (
FileUtilities
.IsBinaryLogFilename(projectFile))
824
else if (outputPropertiesItemsOrTargetResults &&
FileUtilities
.IsSolutionFilename(projectFile))
1304
if (
FileUtilities
.IsVCProjFilename(projectFile) ||
FileUtilities
.IsDspFilename(projectFile))
1401
bool isSolution =
FileUtilities
.IsSolutionFilename(projectFile);
1695
FileUtilities
.ClearCacheDirectory();
2049
if (!ValidateSwitchIndicatorInUnquotedArgument(unquotedCommandLineArg) ||
FileUtilities
.LooksLikeUnixFilePath(unquotedCommandLineArg))
2205
string responseFile =
FileUtilities
.FixFilePath(unquotedCommandLineArg.Substring(1));
2235
var responseFileDirectory =
FileUtilities
.EnsureTrailingSlash(Path.GetDirectoryName(responseFile));
2243
using (StreamReader responseFileContents =
FileUtilities
.OpenRead(responseFile)) // HIGHCHAR: If response files have no byte-order marks, then assume ANSI rather than ASCII.
3031
var projectFile =
FileUtilities
.FixFilePath(projectSwitchParameters[0]);
3062
string directoryResponseFile =
FileUtilities
.GetPathOfFileAbove(directoryResponseFileName, projectDirectory);
3223
writer =
FileUtilities
.OpenWrite(parameters[parameters.Length - 1], append: false);
3242
writer =
FileUtilities
.OpenWrite(parameters[parameters.Length - 1], append: false);
3413
FileUtilities
.ClearCacheDirectory();
3451
FileUtilities
.ClearCacheDirectory();
3521
projectFile =
FileUtilities
.FixFilePath(parameters[0]);
3565
if (
FileUtilities
.IsSolutionFilterFilename(s))
3569
else if (
FileUtilities
.IsSolutionFilename(s))
4095
string logFileName =
FileUtilities
.FixFilePath(ExtractAnyParameterValue(logFileParameter));
4359
string testFile =
FileUtilities
.FixFilePath(loggerAssemblySpec);
4517
string fileName =
FileUtilities
.FixFilePath(parameter);