78 references to ItemSpecModifiers
Microsoft.Build.Utilities.Core (47)
Modifiers.cs (37)
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)) 411GetItemSpecModifier(currentDirectory, itemSpec, definingProjectEscaped, ItemSpecModifiers.FullPath, ref fullPath); 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)) 460GetItemSpecModifier(currentDirectory, itemSpec, definingProjectEscaped, ItemSpecModifiers.FullPath, ref fullPath); 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)) 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)) 567GetItemSpecModifier(currentDirectory, definingProjectEscaped, null, ItemSpecModifiers.RootDir), 568GetItemSpecModifier(currentDirectory, definingProjectEscaped, null, ItemSpecModifiers.Directory)); 574if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectFullPath, StringComparison.OrdinalIgnoreCase)) 576additionalModifier = ItemSpecModifiers.FullPath; 578else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectName, StringComparison.OrdinalIgnoreCase)) 580additionalModifier = ItemSpecModifiers.Filename; 582else if (string.Equals(modifier, FileUtilities.ItemSpecModifiers.DefiningProjectExtension, StringComparison.OrdinalIgnoreCase)) 584additionalModifier = ItemSpecModifiers.Extension;
TaskItem.cs (10)
112if (!FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(key)) 133_definingProject = EscapingUtilities.EscapeWithCaching(sourceItem.GetMetadata(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath)); 138_definingProject = sourceItemAsITaskItem2.GetMetadataValueEscaped(FileUtilities.ItemSpecModifiers.DefiningProjectFullPath); 197int count = (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 206metadataNames.AddRange(FileUtilities.ItemSpecModifiers.All); 216public int MetadataCount => (_metadata?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length; 247ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsItemSpecModifier(metadataName), 269ErrorUtilities.VerifyThrowArgument(!FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName), 439if (FileUtilities.ItemSpecModifiers.IsDerivableItemSpecModifier(metadataName)) 443metadataValue = FileUtilities.ItemSpecModifiers.GetItemSpecModifier(null, _itemSpec, _definingProject, metadataName, ref _fullPath);
Microsoft.Build.Utilities.UnitTests (31)
TaskItem_Tests.cs (31)
45to.GetMetadata(FileUtilities.ItemSpecModifiers.Filename).ShouldBe("Monkey"); 46to.GetMetadata(FileUtilities.ItemSpecModifiers.Extension).ShouldBe(".txt"); 47to.GetMetadata(FileUtilities.ItemSpecModifiers.RelativeDir).ShouldBe(string.Empty); 92taskItem.MetadataNames.Cast<string>().ShouldBeSetEquivalentTo(FileUtilities.ItemSpecModifiers.All); 93taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 98taskItem.MetadataNames.Cast<string>().ShouldBeSetEquivalentTo(FileUtilities.ItemSpecModifiers.All.Concat(new[] { "m" })); 99taskItem.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1); 117h[FileUtilities.ItemSpecModifiers.Filename] = "foo"; 118h[FileUtilities.ItemSpecModifiers.Extension] = "bar"; 124t.GetMetadata(FileUtilities.ItemSpecModifiers.Filename).ShouldBe("bamboo"); 125t.GetMetadata(FileUtilities.ItemSpecModifiers.Extension).ShouldBe(".baz"); 138t.SetMetadata(FileUtilities.ItemSpecModifiers.FullPath, "bazbaz"); 158t.RemoveMetadata(FileUtilities.ItemSpecModifiers.RootDir); 173t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length); 177t.MetadataCount.ShouldBe(FileUtilities.ItemSpecModifiers.All.Length + 1); 185from.GetMetadata(FileUtilities.ItemSpecModifiers.FullPath).ShouldBe( 196from.GetMetadata(FileUtilities.ItemSpecModifiers.RootDir).ShouldBe(Path.GetPathRoot(from.GetMetadata(FileUtilities.ItemSpecModifiers.FullPath))); 204from.GetMetadata(FileUtilities.ItemSpecModifiers.Filename).ShouldBe("Monkey"); 212from.GetMetadata(FileUtilities.ItemSpecModifiers.Extension).ShouldBe(".txt"); 220from.GetMetadata(FileUtilities.ItemSpecModifiers.RelativeDir).Length.ShouldBe(0); 228from.GetMetadata(FileUtilities.ItemSpecModifiers.Directory).ShouldBe(NativeMethodsShared.IsWindows ? @"subdir\" : "subdir/"); 236from.GetMetadata(FileUtilities.ItemSpecModifiers.Directory).ShouldBe(@"subdir\"); 245from.GetMetadata(FileUtilities.ItemSpecModifiers.RecursiveDir).Length.ShouldBe(0); 253from.GetMetadata(FileUtilities.ItemSpecModifiers.Identity).ShouldBe("Monkey.txt"); 262from.GetMetadata(FileUtilities.ItemSpecModifiers.ModifiedTime).Length.ShouldBeGreaterThan(0); 264from.GetMetadata(FileUtilities.ItemSpecModifiers.CreatedTime).Length.ShouldBeGreaterThan(0); 266from.GetMetadata(FileUtilities.ItemSpecModifiers.AccessedTime).Length.ShouldBeGreaterThan(0); 270from.GetMetadata(FileUtilities.ItemSpecModifiers.ModifiedTime).Length.ShouldBe(0); 272from.GetMetadata(FileUtilities.ItemSpecModifiers.CreatedTime).Length.ShouldBe(0); 274from.GetMetadata(FileUtilities.ItemSpecModifiers.AccessedTime).Length.ShouldBe(0);