50 instantiations of AbsolutePath
Microsoft.Build (3)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
1118_requestEntry.TaskEnvironment.ProjectDirectory = new AbsolutePath(_requestEntry.ProjectRootDirectory, ignoreRootedCheck: true); 1461_requestEntry.TaskEnvironment.ProjectDirectory = new AbsolutePath(_requestEntry.RequestConfiguration.SavedCurrentDirectory, ignoreRootedCheck: true);
BackEnd\Components\RequestBuilder\TaskBuilder.cs (1)
443_buildRequestEntry.TaskEnvironment.ProjectDirectory = new AbsolutePath(_buildRequestEntry.ProjectRootDirectory, ignoreRootedCheck: true);
Microsoft.Build.Engine.UnitTests (4)
BackEnd\TaskEnvironment_Tests.cs (4)
188taskEnvironment.ProjectDirectory = new AbsolutePath(testDirectory, ignoreRootedCheck: true); 194taskEnvironment.ProjectDirectory = new AbsolutePath(alternateDirectory, ignoreRootedCheck: true); 229taskEnvironment.ProjectDirectory = new AbsolutePath(baseDirectory, ignoreRootedCheck: true); 274taskEnvironment.ProjectDirectory = new AbsolutePath(testDirectory, ignoreRootedCheck: true);
Microsoft.Build.Framework (13)
FileUtilities.cs (7)
284return new AbsolutePath(EnsureTrailingSlash(path.Value), 312return new AbsolutePath(EnsureNoTrailingSlash(path.Value), 340return new AbsolutePath(FixFilePath(NewPath.GetFullPath(path.Value)), 355return new AbsolutePath(FixFilePath(path.Value), 397return new AbsolutePath(NewPath.GetFullPath(path, workingDir!)); 403return new AbsolutePath(path, new AbsolutePath(workingDir!));
MultiProcessTaskEnvironmentDriver.cs (2)
34get => new AbsolutePath(NativeMethods.GetCurrentDirectory(), ignoreRootedCheck: true); 41return new AbsolutePath(path, ProjectDirectory);
MultiThreadedTaskEnvironmentDriver.cs (3)
35ProjectDirectory = new AbsolutePath(currentDirectoryFullPath, ignoreRootedCheck: true); 52ProjectDirectory = new AbsolutePath(currentDirectoryFullPath, ignoreRootedCheck: true); 71return new AbsolutePath(path, ProjectDirectory);
PathHelpers\AbsolutePath.cs (1)
190return new AbsolutePath(Path.GetFullPath(Value), OriginalValue, ignoreRootedCheck: true);
Microsoft.Build.Framework.UnitTests (28)
AbsolutePath_Tests.cs (28)
18return new AbsolutePath(baseDirectory, ignoreRootedCheck: false); 26var absolutePath = new AbsolutePath(path); 32Should.Throw<ArgumentException>(() => new AbsolutePath(path, ignoreRootedCheck: false), 41var absolutePath = new AbsolutePath(absolutePathString); 52Should.Throw<ArgumentNullException>(() => new AbsolutePath(path!)); 61var exception = Should.Throw<ArgumentException>(() => new AbsolutePath(path)); 71Should.Throw<ArgumentNullException>(() => new AbsolutePath(path!, basePath)); 81var exception = Should.Throw<ArgumentException>(() => new AbsolutePath(path, basePath)); 93var basePath = new AbsolutePath(baseDirectory); 94var absolutePath = new AbsolutePath(relativePath, basePath); 106var path1 = new AbsolutePath(testPath); 107var path2 = new AbsolutePath(testPath); 108var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 120var path1 = new AbsolutePath(testPath); 121var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 133var path1 = new AbsolutePath(testPath); 134var path2 = new AbsolutePath(testPath); 145var path1 = new AbsolutePath(testPath); 146object path2 = new AbsolutePath(testPath); 158var lowerPath = new AbsolutePath("C:\\foo\\bar", ignoreRootedCheck: true); 159var upperPath = new AbsolutePath("C:\\FOO\\BAR", ignoreRootedCheck: true); 170var lowerPath = new AbsolutePath("/foo/bar"); 171var upperPath = new AbsolutePath("/FOO/BAR"); 184Should.Throw<ArgumentException>(() => new AbsolutePath(path, ignoreRootedCheck: ignoreRootedCheck)); 188var absolutePath = new AbsolutePath(path, ignoreRootedCheck: ignoreRootedCheck); 241var absolutePath = new AbsolutePath(null!, null!, ignoreRootedCheck: true); 275var absolutePath = new AbsolutePath(inputPath, ignoreRootedCheck: true); 290var exception = Should.Throw<ArgumentException>(() => new AbsolutePath("relative/path"));
Microsoft.Build.Tasks.Core (1)
WriteCodeFragment.cs (1)
125outputFilePath = new AbsolutePath(FileUtilities.GetTemporaryFile(outputDirectoryPath, null, extension));
Microsoft.Build.Tasks.UnitTests (1)
FileStateTests.cs (1)
23private static AbsolutePath TestPath(string path) => new AbsolutePath(path, ignoreRootedCheck: true);
125 references to AbsolutePath
Microsoft.Build (2)
BackEnd\Components\RequestBuilder\IntrinsicTasks\MSBuild.cs (1)
319AbsolutePath projectPath = TaskEnvironment.GetAbsolutePath(FileUtilities.AttemptToShortenPath(project.ItemSpec));
Evaluation\Expander.cs (1)
4066AbsolutePath? resolved = FileUtilities.MakeFullPathFromThreadWorkingDirectory((string)args[n]);
Microsoft.Build.Engine.UnitTests (5)
BackEnd\TaskEnvironment_Tests.cs (5)
189var retrievedDirectory = taskEnvironment.ProjectDirectory; 195var newRetrievedDirectory = taskEnvironment.ProjectDirectory; 231var absolutePath = taskEnvironment.GetAbsolutePath(relativePath); 253var resultPath = taskEnvironment.GetAbsolutePath(absoluteInputPath); 480var absolutePath = taskEnvironment.GetAbsolutePath(invalidPath);
Microsoft.Build.Framework (41)
FileUtilities.cs (10)
270internal static AbsolutePath EnsureTrailingSlash(AbsolutePath path) 298internal static AbsolutePath EnsureNoTrailingSlash(AbsolutePath path) 326internal static AbsolutePath NormalizePath(AbsolutePath path) 348internal static AbsolutePath FixFilePath(AbsolutePath path) 362/// resolves it to an <see cref="AbsolutePath"/> using the thread-local working directory as base. 379internal static AbsolutePath? MakeFullPathFromThreadWorkingDirectory(string path)
ITaskEnvironmentDriver.cs (2)
21AbsolutePath ProjectDirectory { get; internal set; } 28AbsolutePath GetAbsolutePath(string path);
MultiProcessTaskEnvironmentDriver.cs (2)
32public AbsolutePath ProjectDirectory 39public AbsolutePath GetAbsolutePath(string path)
MultiThreadedTaskEnvironmentDriver.cs (3)
22private AbsolutePath _currentDirectory; 56public AbsolutePath ProjectDirectory 69public AbsolutePath GetAbsolutePath(string path)
PathHelpers\AbsolutePath.cs (22)
24public readonly struct AbsolutePath : IEquatable<AbsolutePath> 42/// Initializes a new instance of the <see cref="AbsolutePath"/> struct. 54/// Initializes a new instance of the <see cref="AbsolutePath"/> struct. 65/// Initializes a new instance of the <see cref="AbsolutePath"/> struct. 100/// Initializes a new instance of the <see cref="AbsolutePath"/> struct by combining an absolute path with a relative path. 105public AbsolutePath(string path, AbsolutePath basePath) 120public static implicit operator string(AbsolutePath path) => path.Value; 126/// An <see cref="AbsolutePath"/> representing the canonical form of the path. 142internal AbsolutePath GetCanonicalForm() 194/// Determines whether two <see cref="AbsolutePath"/> instances are equal. 199public static bool operator ==(AbsolutePath left, AbsolutePath right) => left.Equals(right); 202/// Determines whether two <see cref="AbsolutePath"/> instances are not equal. 207public static bool operator !=(AbsolutePath left, AbsolutePath right) => !left.Equals(right); 210/// Determines whether the specified object is equal to the current <see cref="AbsolutePath"/>. 213/// <returns><c>true</c> if the specified object is an <see cref="AbsolutePath"/> and is equal to the current instance; otherwise, <c>false</c>.</returns> 214public override bool Equals(object? obj) => obj is AbsolutePath other && Equals(other); 217/// Determines whether the specified <see cref="AbsolutePath"/> is equal to the current instance. 219/// <param name="other">The <see cref="AbsolutePath"/> to compare with the current instance.</param> 221public bool Equals(AbsolutePath other) => s_pathComparer.Equals(Value, other.Value); 224/// Returns a hash code for this <see cref="AbsolutePath"/>.
TaskEnvironment.cs (2)
61public AbsolutePath ProjectDirectory 73public AbsolutePath GetAbsolutePath(string path) => _driver.GetAbsolutePath(path);
Microsoft.Build.Framework.UnitTests (24)
AbsolutePath_Tests.cs (24)
15private static AbsolutePath GetTestBasePath() 26var absolutePath = new AbsolutePath(path); 41var absolutePath = new AbsolutePath(absolutePathString); 69var basePath = GetTestBasePath(); 79var basePath = GetTestBasePath(); 93var basePath = new AbsolutePath(baseDirectory); 94var absolutePath = new AbsolutePath(relativePath, basePath); 106var path1 = new AbsolutePath(testPath); 107var path2 = new AbsolutePath(testPath); 108var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 120var path1 = new AbsolutePath(testPath); 121var differentPath = new AbsolutePath(Path.Combine(testPath, "different")); 133var path1 = new AbsolutePath(testPath); 134var path2 = new AbsolutePath(testPath); 145var path1 = new AbsolutePath(testPath); 158var lowerPath = new AbsolutePath("C:\\foo\\bar", ignoreRootedCheck: true); 159var upperPath = new AbsolutePath("C:\\FOO\\BAR", ignoreRootedCheck: true); 170var lowerPath = new AbsolutePath("/foo/bar"); 171var upperPath = new AbsolutePath("/FOO/BAR"); 188var absolutePath = new AbsolutePath(path, ignoreRootedCheck: ignoreRootedCheck); 241var absolutePath = new AbsolutePath(null!, null!, ignoreRootedCheck: true); 242var result = absolutePath.GetCanonicalForm(); 275var absolutePath = new AbsolutePath(inputPath, ignoreRootedCheck: true); 276var result = absolutePath.GetCanonicalForm();
Microsoft.Build.Tasks.Core (52)
AssignTargetPath.cs (4)
59AbsolutePath fullRootPath = default; 73AbsolutePath currentDirectory = FileUtilities.EnsureTrailingSlash(TaskEnvironment.ProjectDirectory); 88AbsolutePath currentDirectory = FileUtilities.EnsureTrailingSlash(TaskEnvironment.ProjectDirectory); 128AbsolutePath itemSpecFullFileNamePath =
Copy.cs (6)
511AbsolutePath sourceAbsolutePath; 512AbsolutePath destAbsolutePath; 666AbsolutePath prevSourceAbsolutePath = default; 677AbsolutePath sourceAbsolutePath; 678AbsolutePath destAbsolutePath; 850AbsolutePath src = FileUtilities.NormalizePath(TaskEnvironment.GetAbsolutePath(sourceFolder.ItemSpec));
Delete.cs (1)
125AbsolutePath? filePath = null;
DownloadFile.cs (1)
182AbsolutePath destinationFolderPath = TaskEnvironment.GetAbsolutePath(DestinationFolder.ItemSpec);
FileIO\GetFileHash.cs (1)
91AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(file.ItemSpec);
FileIO\ReadLinesFromFile.cs (1)
45AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(File.ItemSpec);
FileIO\VerifyFileHash.cs (1)
46AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(File);
FileIO\WriteLinesToFile.cs (7)
75AbsolutePath filePath = FileUtilities.NormalizePath(TaskEnvironment.GetAbsolutePath(File.ItemSpec)); 127private bool ExecuteNonTransactional(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 155private bool ExecuteTransactional(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 187private bool SaveAtomically(AbsolutePath filePath, string contentsAsString, Encoding encoding) 289private bool SaveAtomicallyAppend(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 311private bool ShouldWriteFileForOverwrite(AbsolutePath filePath, string contentsAsString) 352private bool FilesAreIdentical(AbsolutePath filePath, string contentsAsString)
FileState.cs (2)
240internal FileState(AbsolutePath path) 305internal AbsolutePath Path
MakeDir.cs (1)
60AbsolutePath? absolutePath = null;
Move.cs (5)
161AbsolutePath? sourceFile = null; 162AbsolutePath? destinationFile = null; 198private static void MakeWriteableIfReadOnly(AbsolutePath file) 212AbsolutePath sourceFile, 213AbsolutePath destinationFile)
RemoveDir.cs (2)
68AbsolutePath directoryPath = TaskEnvironment.GetAbsolutePath(directory.ItemSpec); 119private bool RemoveDirectory(AbsolutePath directoryPath, bool logUnauthorizedError, out bool unauthorizedAccess)
Touch.cs (3)
98AbsolutePath path; 182AbsolutePath file, 205AbsolutePath file,
Unzip.cs (2)
94AbsolutePath destinationPath = TaskEnvironment.GetAbsolutePath(DestinationFolder.ItemSpec); 114AbsolutePath sourceFilePath;
WriteCodeFragment.cs (2)
110AbsolutePath outputFilePath = default; 124AbsolutePath outputDirectoryPath = TaskEnvironment.GetAbsolutePath(OutputDirectory.ItemSpec);
XmlPeek.cs (3)
74AbsolutePath? absoluteInputPath = XmlInputPath != null ? TaskEnvironment.GetAbsolutePath(XmlInputPath.ItemSpec) : null; 225private readonly AbsolutePath? _filePath; 243public XmlInput(AbsolutePath? xmlInputPath, string xmlContent)
XmlPoke.cs (1)
68AbsolutePath inputPath;
XslTransformation.cs (7)
112AbsolutePath?[] absoluteXmlInputPaths = XmlInputPaths != null 113? Array.ConvertAll(XmlInputPaths, item => item.ItemSpec != null ? TaskEnvironment.GetAbsolutePath(item.ItemSpec) : (AbsolutePath?)null) 117AbsolutePath? absoluteXslInputPath = XslInputPath?.ItemSpec != null ? TaskEnvironment.GetAbsolutePath(XslInputPath.ItemSpec) : null; 274private readonly AbsolutePath?[] _filePaths; 287public XmlInput(AbsolutePath?[] xmlFilePaths, string xml) 366private readonly AbsolutePath? _filePath; 400public XsltInput(AbsolutePath? xsltFilePath, string xslt, string xsltCompiledDllSpec, TaskEnvironment taskEnvironment, TaskLoggingHelper logTool, bool preserveWhitespace)
ZipDirectory.cs (2)
66AbsolutePath sourceDirectoryAbsolutePath = TaskEnvironment.GetAbsolutePath(SourceDirectory.ItemSpec); 75AbsolutePath destinationFileAbsolutePath = TaskEnvironment.GetAbsolutePath(DestinationFile.ItemSpec);
Microsoft.Build.Tasks.UnitTests (1)
FileStateTests.cs (1)
23private static AbsolutePath TestPath(string path) => new AbsolutePath(path, ignoreRootedCheck: true);