57 instantiations of AbsolutePath
Microsoft.Build (3)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
1124_requestEntry.TaskEnvironment.ProjectDirectory = new AbsolutePath(_requestEntry.ProjectRootDirectory, ignoreRootedCheck: true); 1459_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)
35get => new AbsolutePath(NativeMethods.GetCurrentDirectory(), ignoreRootedCheck: true); 42return new AbsolutePath(path, ProjectDirectory);
MultiThreadedTaskEnvironmentDriver.cs (3)
36ProjectDirectory = new AbsolutePath(currentDirectoryFullPath, ignoreRootedCheck: true); 53ProjectDirectory = new AbsolutePath(currentDirectoryFullPath, ignoreRootedCheck: true); 72return new AbsolutePath(path, ProjectDirectory);
PathHelpers\AbsolutePath.cs (1)
144return new AbsolutePath(System.IO.Path.GetFullPath(Value), OriginalValue, ignoreRootedCheck: true);
Microsoft.Build.Framework.UnitTests (29)
AbsolutePath_Tests.cs (29)
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); 273var absolutePath = new AbsolutePath(inputPath, ignoreRootedCheck: true); 291var absolutePath = new AbsolutePath(invalidPath, ignoreRootedCheck: true); 308var exception = Should.Throw<ArgumentException>(() => new AbsolutePath("relative/path"));
Microsoft.Build.Tasks.Core (6)
AddToWin32Manifest.cs (1)
115return defaultManifestPath is null ? null : new AbsolutePath(defaultManifestPath);
GetReferenceAssemblyPaths.cs (1)
170: new AbsolutePath(RootPath, ignoreRootedCheck: true);
SGen.cs (2)
260private AbsolutePath SerializationAssemblyPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, SerializationAssemblyName)); 262private AbsolutePath AssemblyFullPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, BuildAssemblyName));
TaskEnvironmentExtensions.cs (1)
29? new AbsolutePath(paths[i], ignoreRootedCheck: true)
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);
Microsoft.Build.Utilities.Core (1)
ToolTask.cs (1)
893AbsolutePath filePath = !string.IsNullOrEmpty(fileName) ? TaskEnvironment.GetAbsolutePath(fileName) : new AbsolutePath(fileName, ignoreRootedCheck: true);
167 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)
33public AbsolutePath ProjectDirectory 40public AbsolutePath GetAbsolutePath(string path)
MultiThreadedTaskEnvironmentDriver.cs (3)
23private AbsolutePath _currentDirectory; 57public AbsolutePath ProjectDirectory 70public 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() 148/// Determines whether two <see cref="AbsolutePath"/> instances are equal. 153public static bool operator ==(AbsolutePath left, AbsolutePath right) => left.Equals(right); 156/// Determines whether two <see cref="AbsolutePath"/> instances are not equal. 161public static bool operator !=(AbsolutePath left, AbsolutePath right) => !left.Equals(right); 164/// Determines whether the specified object is equal to the current <see cref="AbsolutePath"/>. 167/// <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> 168public override bool Equals(object? obj) => obj is AbsolutePath other && Equals(other); 171/// Determines whether the specified <see cref="AbsolutePath"/> is equal to the current instance. 173/// <param name="other">The <see cref="AbsolutePath"/> to compare with the current instance.</param> 175public bool Equals(AbsolutePath other) => s_pathComparer.Equals(Value, other.Value); 178/// 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); 273var absolutePath = new AbsolutePath(inputPath, ignoreRootedCheck: true); 274var result = absolutePath.GetCanonicalForm(); 291var absolutePath = new AbsolutePath(invalidPath, ignoreRootedCheck: true);
Microsoft.Build.Tasks.Core (90)
AddToWin32Manifest.cs (5)
93private AbsolutePath? GetManifestPath() 103AbsolutePath absolutePath = TaskEnvironment.GetAbsolutePath(ApplicationManifest.ItemSpec); 118private Stream? GetManifestStream(AbsolutePath? path) 129AbsolutePath? manifestPath = GetManifestPath(); 184AbsolutePath outputPath = TaskEnvironment.GetAbsolutePath(originalPath);
AssignTargetPath.cs (4)
59AbsolutePath fullRootPath = default; 73AbsolutePath currentDirectory = FileUtilities.EnsureTrailingSlash(TaskEnvironment.ProjectDirectory); 90AbsolutePath currentDirectory = FileUtilities.EnsureTrailingSlash(TaskEnvironment.ProjectDirectory); 130AbsolutePath itemSpecFullFileNamePath =
Copy.cs (6)
517AbsolutePath sourceAbsolutePath; 518AbsolutePath destAbsolutePath; 672AbsolutePath prevSourceAbsolutePath = default; 683AbsolutePath sourceAbsolutePath; 684AbsolutePath destAbsolutePath; 856AbsolutePath src = FileUtilities.NormalizePath(TaskEnvironment.GetAbsolutePath(sourceFolder.ItemSpec));
CreateManifestResourceName.cs (3)
125private static Stream CreateFileStreamOverNewFileStream(AbsolutePath path, FileMode mode, FileAccess access) 196AbsolutePath dependentPath = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), conventionDependentUpon)); 221AbsolutePath pathToDependent = TaskEnvironment.GetAbsolutePath(Path.Combine(Path.GetDirectoryName(fileName), dependentUpon));
Delegate.cs (1)
121internal delegate Stream CreateFileStream(AbsolutePath path, FileMode mode, FileAccess access);
Delete.cs (1)
125AbsolutePath? filePath = null;
DownloadFile.cs (1)
182AbsolutePath destinationFolderPath = TaskEnvironment.GetAbsolutePath(DestinationFolder.ItemSpec);
FileIO\GetFileHash.cs (2)
91AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(file.ItemSpec); 146internal static byte[] ComputeHash(Func<HashAlgorithm> algorithmFactory, AbsolutePath filePath, CancellationToken ct)
FileIO\ReadLinesFromFile.cs (1)
45AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(File.ItemSpec);
FileIO\VerifyFileHash.cs (1)
46AbsolutePath filePath = TaskEnvironment.GetAbsolutePath(File);
FileIO\WriteLinesToFile.cs (7)
94AbsolutePath filePath = FileUtilities.NormalizePath(TaskEnvironment.GetAbsolutePath(File.ItemSpec)); 146private bool ExecuteNonTransactional(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 174private bool ExecuteTransactional(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 208private bool SaveAtomically(AbsolutePath filePath, string contentsAsString, Encoding encoding) 282private bool SaveAtomicallyAppend(AbsolutePath filePath, string directoryPath, string contentsAsString, Encoding encoding) 304private bool ShouldWriteFileForOverwrite(AbsolutePath filePath, string contentsAsString) 345private bool FilesAreIdentical(AbsolutePath filePath, string contentsAsString)
FileState.cs (2)
250internal FileState(AbsolutePath path) 315internal AbsolutePath Path
GenerateApplicationManifest.cs (2)
289AbsolutePath trustInfoPath = TaskEnvironment.GetAbsolutePath(TrustInfoFile.ItemSpec); 458AbsolutePath inputManifestPath = TaskEnvironment.GetAbsolutePath(InputManifest.ItemSpec);
GenerateManifestBase.cs (2)
458AbsolutePath inputManifestPath = TaskEnvironment.GetAbsolutePath(InputManifest.ItemSpec); 620AbsolutePath outputManifestPath = TaskEnvironment.GetAbsolutePath(OutputManifest.ItemSpec);
GetInstalledSDKLocations.cs (2)
147AbsolutePath[] absoluteDirectoryRoots = TaskEnvironment.GetAbsolutePathsOrNull(SDKDirectoryRoots); 148AbsolutePath[] absoluteExtensionRoots = TaskEnvironment.GetAbsolutePathsOrNull(SDKExtensionDirectoryRoots);
GetReferenceAssemblyPaths.cs (6)
168AbsolutePath? absoluteRootPath = !string.IsNullOrEmpty(RootPath) 171IList<AbsolutePath> absoluteFallbackSearchPaths = ResolveAbsoluteFallbackSearchPaths(TargetFrameworkFallbackSearchPaths); 255private IList<String> GetPaths(AbsolutePath? rootPath, IList<AbsolutePath> fallbackSearchPaths, FrameworkNameVersioning frameworkmoniker) 291private IList<AbsolutePath> ResolveAbsoluteFallbackSearchPaths(string fallbackSearchPaths) 299var result = new AbsolutePath[parts.Length];
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)
NativeMethods.cs (2)
580internal static bool MoveFileEx(AbsolutePath existingFileName, AbsolutePath newFileName, MoveFileFlags flags)
RemoveDir.cs (2)
68AbsolutePath directoryPath = TaskEnvironment.GetAbsolutePath(directory.ItemSpec); 119private bool RemoveDirectory(AbsolutePath directoryPath, bool logUnauthorizedError, out bool unauthorizedAccess)
SGen.cs (2)
260private AbsolutePath SerializationAssemblyPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, SerializationAssemblyName)); 262private AbsolutePath AssemblyFullPath => new AbsolutePath(Path.Combine(BuildAssemblyPath, BuildAssemblyName));
TaskEnvironmentExtensions.cs (5)
9/// Extension methods for <see cref="TaskEnvironment"/> and <see cref="AbsolutePath"/> used by built-in tasks. 18internal static AbsolutePath[]? GetAbsolutePathsOrNull(this TaskEnvironment taskEnvironment, string[]? paths) 25var result = new AbsolutePath[paths.Length]; 37/// Converts an array of <see cref="AbsolutePath"/> to a string array. 40internal static string[]? ToStringArray(this AbsolutePath[]? paths)
Touch.cs (3)
98AbsolutePath path; 182AbsolutePath file, 205AbsolutePath file,
Unzip.cs (4)
94AbsolutePath destinationPath = TaskEnvironment.GetAbsolutePath(DestinationFolder.ItemSpec); 114AbsolutePath sourceFilePath; 179AbsolutePath fullDestinationDirectoryPath = TaskEnvironment.GetAbsolutePath(FileUtilities.EnsureTrailingSlash(destinationDirectory.FullName)).GetCanonicalForm(); 189AbsolutePath fullDestinationPath = TaskEnvironment.GetAbsolutePath(Path.Combine(destinationDirectory.FullName, zipArchiveEntry.FullName)).GetCanonicalForm();
UpdateManifest.cs (3)
42AbsolutePath inputManifestPath = TaskEnvironment.GetAbsolutePath(InputManifest.ItemSpec); 43AbsolutePath outputManifestPath = TaskEnvironment.GetAbsolutePath(OutputManifest.ItemSpec); 44AbsolutePath applicationManifestPath = TaskEnvironment.GetAbsolutePath(ApplicationManifest.ItemSpec);
WinMDExp.cs (2)
285AbsolutePath outputWindowsMetadataFile = TaskEnvironment.GetAbsolutePath(OutputWindowsMetadataFile); 286AbsolutePath winMDModule = TaskEnvironment.GetAbsolutePath(WinMDModule);
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 (2)
CreateCSharpManifestResourceName_Tests.cs (1)
776private Stream CreateFileStream(AbsolutePath path, FileMode mode, FileAccess access)
FileStateTests.cs (1)
23private static AbsolutePath TestPath(string path) => new AbsolutePath(path, ignoreRootedCheck: true);
Microsoft.Build.Utilities.Core (3)
ToolTask.cs (3)
893AbsolutePath filePath = !string.IsNullOrEmpty(fileName) ? TaskEnvironment.GetAbsolutePath(fileName) : new AbsolutePath(fileName, ignoreRootedCheck: true); 898/// Overload of <see cref="DeleteTempFile(string)"/> that accepts an <see cref="AbsolutePath"/>. 903protected void DeleteTempFile(AbsolutePath filePath)