1 interface inheriting from IMSBuildItem
NuGet.Build.Tasks.Console (1)
IMSBuildProject.cs (1)
12internal interface IMSBuildProject : IMSBuildItem
4 implementations of IMSBuildItem
NuGet.Build.Tasks (1)
Common\MSBuildTaskItem.cs (1)
18public class MSBuildTaskItem : IMSBuildItem
NuGet.Build.Tasks.Console (1)
MSBuildItemBase.cs (1)
15internal abstract class MSBuildItemBase : IMSBuildItem
NuGet.Build.Tasks.Pack (1)
Common\MSBuildTaskItem.cs (1)
18public class MSBuildTaskItem : IMSBuildItem
NuGet.Commands (1)
RestoreCommand\RequestFactory\MSBuildItem.cs (1)
15public class MSBuildItem : IMSBuildItem
148 references to IMSBuildItem
NuGet.Build.Tasks (3)
Common\MSBuildUtility.cs (3)
15public static IMSBuildItem WrapMSBuildItem(ITaskItem item) 25public static IMSBuildItem[] WrapMSBuildItem(IEnumerable<ITaskItem> items) 29return new IMSBuildItem[0];
NuGet.Build.Tasks.Console (40)
ExtensionMethods.cs (7)
20/// <param name="item">The <see cref="IMSBuildItem" /> to get the metadata value from.</param> 24public static bool IsPropertyFalse(this IMSBuildItem item, string name, bool defaultValue = false) 32/// <param name="item">The <see cref="IMSBuildItem" /> to get the metadata value from.</param> 36public static bool IsPropertyTrue(this IMSBuildItem item, string name, bool defaultValue = false) 44/// <param name="item">The <see cref="IMSBuildItem" /> to get the property value from.</param> 47public static string[] SplitPropertyValueOrNull(this IMSBuildItem item, string name) 57/// <param name="item">The <see cref="IMSBuildItem" /> to get the property value from.</param>
IMSBuildProject.cs (1)
36IEnumerable<IMSBuildItem> GetItems(string name);
MSBuildItemBase.cs (4)
17/// <inheritdoc cref="IMSBuildItem.Identity" /> 21/// <inheritdoc cref="IMSBuildItem.Properties" /> 24/// <inheritdoc cref="IMSBuildItem.GetProperty(string)" /> 30/// <inheritdoc cref="IMSBuildItem.GetProperty(string, bool)" />
MSBuildProjectInstance.cs (1)
48public IEnumerable<IMSBuildItem> GetItems(string name)
MSBuildStaticGraphRestore.cs (23)
260List<IMSBuildItem> frameworkReferenceItems = GetDistinctItemsOrEmpty(project, "FrameworkReference").ToList(); 273var frameworkReferenceItem = frameworkReferenceItems[i]; 290foreach (IMSBuildItem projectItemInstance in GetDistinctItemsOrEmpty(project, "PackageDownload")) 324IEnumerable<IMSBuildItem> packageVersionItems = GetDistinctItemsOrEmpty(project, "PackageVersion"); 326foreach (var projectItemInstance in packageVersionItems) 347List<IMSBuildItem> packageReferenceItems = GetDistinctItemsOrEmpty(project, "PackageReference").ToList(); 353var packageReferenceItem = packageReferenceItems[i]; 400IEnumerable<IMSBuildItem> PrunePackageReferences = GetDistinctItemsOrEmpty(project, "PrunePackageReference"); 402foreach (var projectItemInstance in PrunePackageReferences) 415/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 429/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 468foreach (var projectReferenceItem in projectReferenceItems) 556/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 558internal static NuGetVersion GetProjectVersion(IMSBuildItem project) 575internal static NuGetVersion GetSdkVersion(IMSBuildItem project) 590/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 614/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 626/// <param name="project">An <see cref="IMSBuildItem" /> representing the project..</param> 646/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 648internal static bool IsLegacyProject(IMSBuildItem project) 1296/// Two items are equal if they have the same <see cref="IMSBuildItem.Identity"/>. 1301private static IEnumerable<IMSBuildItem> GetDistinctItemsOrEmpty(IMSBuildProject project, string itemName) 1303return project.GetItems(itemName)?.Distinct(ProjectItemInstanceEvaluatedIncludeComparer.Instance) ?? Enumerable.Empty<IMSBuildItem>();
ProjectItemInstanceEvaluatedIncludeComparer.cs (4)
17internal sealed class ProjectItemInstanceEvaluatedIncludeComparer : IEqualityComparer<IMSBuildItem> 38public bool Equals(IMSBuildItem x, IMSBuildItem y) 43public int GetHashCode(IMSBuildItem obj) => StringComparer.OrdinalIgnoreCase.GetHashCode(obj.Identity);
NuGet.Build.Tasks.Pack (42)
Common\MSBuildUtility.cs (3)
16public static IMSBuildItem WrapMSBuildItem(ITaskItem item) 26public static IMSBuildItem[] WrapMSBuildItem(IEnumerable<ITaskItem> items) 30return Array.Empty<IMSBuildItem>();
IPackTaskLogic.cs (5)
20PackArgs GetPackArgs(IPackTaskRequest<IMSBuildItem> request); 25PackageBuilder GetPackageBuilder(IPackTaskRequest<IMSBuildItem> request); 29/// <see cref="GetPackArgs(IPackTaskRequest{IMSBuildItem})"/> and 30/// <see cref="GetPackageBuilder(IPackTaskRequest{IMSBuildItem})"/>. 33IPackTaskRequest<IMSBuildItem> request,
IPackTaskRequest.cs (1)
14/// The item type. This will either be <see cref="ITaskItem"/> or a <see cref="IMSBuildItem"/>.
PackTask.cs (1)
164private IPackTaskRequest<IMSBuildItem> GetRequest()
PackTaskLogic.cs (22)
31public PackArgs GetPackArgs(IPackTaskRequest<IMSBuildItem> request) 110public PackageBuilder GetPackageBuilder(IPackTaskRequest<IMSBuildItem> request) 252private LicenseMetadata BuildLicenseMetadata(IPackTaskRequest<IMSBuildItem> request) 320private static Version GetLicenseExpressionVersion(IPackTaskRequest<IMSBuildItem> request) 342private LockFile GetAssetsFile(IPackTaskRequest<IMSBuildItem> request) 410private static void PopulateFrameworkAssemblyReferences(PackageBuilder builder, IPackTaskRequest<IMSBuildItem> request) 415foreach (var tfmRef in request.FrameworkAssemblyReferences) 488IPackTaskRequest<IMSBuildItem> request, 507private static IEnumerable<OutputLibFile> InitLibFiles(IMSBuildItem[] libFiles, IDictionary<string, string> targetAliasToNuGetFramework, Dictionary<string, List<string>> nuGetFrameworkToDuplicateAliases) 519foreach (var assembly in libFiles) 577private static ISet<NuGetFramework> ParseFrameworks(IPackTaskRequest<IMSBuildItem> request, IDictionary<string, string> targetAliasToNuGetFramework) 597private ICollection<PackageType> ParsePackageTypes(IPackTaskRequest<IMSBuildItem> request) 618private void InitCurrentDirectoryAndFileName(IPackTaskRequest<IMSBuildItem> request, PackArgs packArgs) 642private void InitNuspecOutputPath(IPackTaskRequest<IMSBuildItem> request, PackArgs packArgs) 657IPackTaskRequest<IMSBuildItem> request, 665foreach (var packageFile in request.PackageFiles) 694private IEnumerable<ContentMetadata> GetContentMetadata(IMSBuildItem packageFile, string sourcePath, 827private string GetSourcePath(IMSBuildItem packageFile) 839private ISet<string> CalculateFilesToExcludeInPack(IPackTaskRequest<IMSBuildItem> request) 844foreach (var file in request.PackageFilesToExclude) 853private IDictionary<string, string> GetSourceFiles(IPackTaskRequest<IMSBuildItem> request, string currentProjectDirectory) 858foreach (var src in request.SourceFiles)
PackTaskRequest.cs (10)
11public class PackTaskRequest : IPackTaskRequest<IMSBuildItem> 17public IMSBuildItem[] BuildOutputInPackage { get; set; } 24public IMSBuildItem[] FrameworkAssemblyReferences { get; set; } 38public IMSBuildItem[] PackageFiles { get; set; } 39public IMSBuildItem[] PackageFilesToExclude { get; set; } 44public IMSBuildItem PackItem { get; set; } 45public IMSBuildItem[] ProjectReferencesWithVersions { get; set; } 59public IMSBuildItem[] SourceFiles { get; set; } 62public IMSBuildItem[] TargetPathsToSymbols { get; set; } 68public IMSBuildItem[] FrameworksWithSuppressedDependencies { get; set; }
NuGet.Commands (63)
RestoreCommand\RequestFactory\MSBuildItemIdentityComparer.cs (6)
12/// A comparer for the <see cref="IMSBuildItem"/> based on the <see cref="IMSBuildItem.Identity"/>. 14internal sealed class MSBuildItemIdentityComparer : IEqualityComparer<IMSBuildItem> 22public bool Equals(IMSBuildItem x, IMSBuildItem y) 27public int GetHashCode(IMSBuildItem obj)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (55)
38/// <param name="items">An <see cref="IEnumerable{T}" /> of <see cref="IMSBuildItem" /> objects representing the MSBuild items gathered for restore.</param> 39public static DependencyGraphSpec GetDependencySpec(IEnumerable<IMSBuildItem> items) 46/// <param name="items">An <see cref="IEnumerable{T}" /> of <see cref="IMSBuildItem" /> objects representing the MSBuild items gathered for restore.</param> 48public static DependencyGraphSpec GetDependencySpec(IEnumerable<IMSBuildItem> items, bool readOnly) 61var itemsById = new Dictionary<string, List<IMSBuildItem>>(uniqueNameComparer); 67foreach (var item in items) 77List<IMSBuildItem> idItems; 80idItems = new List<IMSBuildItem>(1); 158public static PackageSpec GetPackageSpec(IEnumerable<IMSBuildItem> items) 170var specItem = GetItemByType(items, "projectSpec").FirstOrDefault(); 435private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 438foreach (var item in GetItemByType(items, "TargetFrameworkInformation")) 523private static RuntimeGraph GetRuntimeGraph(IMSBuildItem specItem) 538private static void AddProjectReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 587private static Tuple<List<string>, ProjectRestoreReference> GetProjectRestoreReference(IMSBuildItem item) 635private static void AddPackageReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items, bool isCpvmEnabled) 648foreach (var item in GetItemByType(items, "Dependency")) 704internal static void AddPrunePackageReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 713List<IMSBuildItem> targetFrameworkInfos = GetItemByType(items, "TargetFrameworkInformation").ToList(); 715foreach (var item in targetFrameworkInfos) 724foreach (var item in targetFrameworkInfos) 734foreach (var item in GetItemByType(items, "PrunePackageReference")) 777internal static void AddPackageDownloads(PackageSpec spec, IEnumerable<IMSBuildItem> items) 781foreach (var item in GetItemByType(items, "DownloadDependency")) 812private static (LibraryIncludeFlags includeType, LibraryIncludeFlags suppressParent) GetLibraryDependencyIncludeFlags(IMSBuildItem item) 831private static void AddFrameworkReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 833foreach (var item in GetItemByType(items, "FrameworkReference")) 865private static VersionRange GetVersionRange(IMSBuildItem item, VersionRange defaultValue, string propertyName = "VersionRange") 881private static PackageSpec GetBaseSpec(IMSBuildItem specItem, ProjectStyle projectStyle, IEnumerable<IMSBuildItem> items) 911private static HashSet<string> GetFrameworks(IMSBuildItem item) 916private static HashSet<string> GetTargetFrameworkStrings(IMSBuildItem item) 929private static IEnumerable<IMSBuildItem> GetItemByType(IEnumerable<IMSBuildItem> items, string type) 934private static bool IsType(this IMSBuildItem item, string type) 942private static NuGetVersion GetVersion(IMSBuildItem item) 961public static void Dump(IEnumerable<IMSBuildItem> items, ILogger log) 963foreach (var item in items) 979private static WarningProperties GetWarningProperties(IMSBuildItem specItem) 988private static RestoreLockProperties GetRestoreLockProperties(IMSBuildItem specItem) 996public static RestoreAuditProperties GetRestoreAuditProperties(IMSBuildItem specItem, IEnumerable<IMSBuildItem> allItems, HashSet<string> suppressionItems) 1020string GetAuditMode(IMSBuildItem project, IEnumerable<IMSBuildItem> tfms) 1022foreach (var item in tfms.NoAllocEnumerate()) 1066private static HashSet<string> GetAuditSuppressions(IEnumerable<IMSBuildItem> items) 1113internal static bool IsPropertyFalse(IMSBuildItem item, string propertyName, bool defaultValue = false) 1125internal static bool IsPropertyTrue(IMSBuildItem item, string propertyName, bool defaultValue = false) 1156private static Dictionary<string, Dictionary<string, CentralPackageVersion>> CreateCentralVersionDependencies(IEnumerable<IMSBuildItem> items, 1159IEnumerable<IMSBuildItem> centralVersions = GetItemByType(items, "CentralPackageVersion")?.Distinct(MSBuildItemIdentityComparer.Default).ToList(); 1162foreach (IMSBuildItem cv in centralVersions) 1198private static ProjectStyle GetProjectStyle(IMSBuildItem projectSpecItem) 1214/// <param name="projectSpecItem">The <see cref="IMSBuildItem" /> to get the central package management settings from.</param> 1217public static (bool IsEnabled, bool IsVersionOverrideDisabled, bool IsCentralPackageTransitivePinningEnabled, bool isCentralPackageFloatingVersionsEnabled) GetCentralPackageManagementSettings(IMSBuildItem projectSpecItem, ProjectStyle projectStyle) 1231private static void AddCentralPackageVersions(PackageSpec spec, IEnumerable<IMSBuildItem> items)
RestoreCommand\Utility\PackageSpecFactory.cs (2)
670/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 934/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param>