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
156 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)
268List<IMSBuildItem> frameworkReferenceItems = GetDistinctItemsOrEmpty(project, "FrameworkReference").ToList(); 281var frameworkReferenceItem = frameworkReferenceItems[i]; 298foreach (IMSBuildItem projectItemInstance in GetDistinctItemsOrEmpty(project, "PackageDownload")) 332IEnumerable<IMSBuildItem> packageVersionItems = GetDistinctItemsOrEmpty(project, "PackageVersion"); 334foreach (var projectItemInstance in packageVersionItems) 355List<IMSBuildItem> packageReferenceItems = GetDistinctItemsOrEmpty(project, "PackageReference").ToList(); 361var packageReferenceItem = packageReferenceItems[i]; 408IEnumerable<IMSBuildItem> PrunePackageReferences = GetDistinctItemsOrEmpty(project, "PrunePackageReference"); 410foreach (var projectItemInstance in PrunePackageReferences) 423/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 437/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 476foreach (var projectReferenceItem in projectReferenceItems) 573/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 575internal static NuGetVersion GetProjectVersion(IMSBuildItem project) 592internal static NuGetVersion GetSdkVersion(IMSBuildItem project) 607/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 631/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 650/// <param name="project">An <see cref="IMSBuildItem" /> representing the project..</param> 670/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 672internal static bool IsLegacyProject(IMSBuildItem project) 1418/// Two items are equal if they have the same <see cref="IMSBuildItem.Identity"/>. 1423private static IEnumerable<IMSBuildItem> GetDistinctItemsOrEmpty(IMSBuildProject project, string itemName) 1425return 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)
166private IPackTaskRequest<IMSBuildItem> GetRequest()
PackTaskLogic.cs (22)
31public PackArgs GetPackArgs(IPackTaskRequest<IMSBuildItem> request) 105public PackageBuilder GetPackageBuilder(IPackTaskRequest<IMSBuildItem> request) 247private LicenseMetadata BuildLicenseMetadata(IPackTaskRequest<IMSBuildItem> request) 315private static Version GetLicenseExpressionVersion(IPackTaskRequest<IMSBuildItem> request) 337private LockFile GetAssetsFile(IPackTaskRequest<IMSBuildItem> request) 405private static void PopulateFrameworkAssemblyReferences(PackageBuilder builder, IPackTaskRequest<IMSBuildItem> request) 410foreach (var tfmRef in request.FrameworkAssemblyReferences) 483IPackTaskRequest<IMSBuildItem> request, 502private static IEnumerable<OutputLibFile> InitLibFiles(IMSBuildItem[] libFiles, IDictionary<string, string> targetAliasToNuGetFramework, Dictionary<string, List<string>> nuGetFrameworkToDuplicateAliases) 514foreach (var assembly in libFiles) 572private static ISet<NuGetFramework> ParseFrameworks(IPackTaskRequest<IMSBuildItem> request, IDictionary<string, string> targetAliasToNuGetFramework) 592private ICollection<PackageType> ParsePackageTypes(IPackTaskRequest<IMSBuildItem> request) 613private void InitCurrentDirectoryAndFileName(IPackTaskRequest<IMSBuildItem> request, PackArgs packArgs) 637private void InitNuspecOutputPath(IPackTaskRequest<IMSBuildItem> request, PackArgs packArgs) 652IPackTaskRequest<IMSBuildItem> request, 660foreach (var packageFile in request.PackageFiles) 689private IEnumerable<ContentMetadata> GetContentMetadata(IMSBuildItem packageFile, string sourcePath, 822private string GetSourcePath(IMSBuildItem packageFile) 834private ISet<string> CalculateFilesToExcludeInPack(IPackTaskRequest<IMSBuildItem> request) 839foreach (var file in request.PackageFilesToExclude) 848private IDictionary<string, string> GetSourceFiles(IPackTaskRequest<IMSBuildItem> request, string currentProjectDirectory) 853foreach (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 (71)
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 (62)
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) 57/// <param name="items">An <see cref="IEnumerable{T}" /> of <see cref="IMSBuildItem" /> objects representing the MSBuild items gathered for restore.</param> 60public static (DependencyGraphSpec, IReadOnlyList<IAssetsLogMessage>) GetDependencySpec(IEnumerable<IMSBuildItem> items, bool readOnly, bool collectAdditionalMessages) 73var itemsById = new Dictionary<string, List<IMSBuildItem>>(uniqueNameComparer); 79foreach (var item in items) 89List<IMSBuildItem> idItems; 92idItems = new List<IMSBuildItem>(1); 191public static PackageSpec GetPackageSpec(IEnumerable<IMSBuildItem> items) 203var specItem = GetItemByType(items, "projectSpec").FirstOrDefault(); 342private static PackageSpec CreateErrorSpecFromItems(IEnumerable<IMSBuildItem> items, string errorDetails, List<IAssetsLogMessage> additionalMessages) 344var specItem = GetItemByType(items, "projectSpec").FirstOrDefault(); 519private static IEnumerable<TargetFrameworkInformation> GetTargetFrameworkInformation(string filePath, ProjectStyle restoreType, IEnumerable<IMSBuildItem> items) 522foreach (var item in GetItemByType(items, "TargetFrameworkInformation")) 607private static RuntimeGraph GetRuntimeGraph(IMSBuildItem specItem) 622private static void AddProjectReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 672private static Tuple<List<string>, ProjectRestoreReference> GetProjectRestoreReference(IMSBuildItem item, bool crossTargeting) 720private static void AddPackageReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items, bool isCpvmEnabled) 733foreach (var item in GetItemByType(items, "Dependency")) 789internal static void AddPrunePackageReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 798List<IMSBuildItem> targetFrameworkInfos = GetItemByType(items, "TargetFrameworkInformation").ToList(); 800foreach (var item in targetFrameworkInfos) 809foreach (var item in targetFrameworkInfos) 819foreach (var item in GetItemByType(items, "PrunePackageReference")) 861internal static void AddPackageDownloads(PackageSpec spec, IEnumerable<IMSBuildItem> items) 865foreach (var item in GetItemByType(items, "DownloadDependency")) 896private static (LibraryIncludeFlags includeType, LibraryIncludeFlags suppressParent) GetLibraryDependencyIncludeFlags(IMSBuildItem item) 915private static void AddFrameworkReferences(PackageSpec spec, IEnumerable<IMSBuildItem> items) 917foreach (var item in GetItemByType(items, "FrameworkReference")) 948private static VersionRange GetVersionRange(IMSBuildItem item, VersionRange defaultValue, string propertyName = "VersionRange") 964private static PackageSpec GetBaseSpec(IMSBuildItem specItem, ProjectStyle projectStyle, IEnumerable<IMSBuildItem> items) 994private static HashSet<string> GetFrameworks(IMSBuildItem item, bool crossTargeting) 999private static HashSet<string> GetTargetFrameworkStrings(IMSBuildItem item, bool crossTargeting) 1019private static IEnumerable<IMSBuildItem> GetItemByType(IEnumerable<IMSBuildItem> items, string type) 1024private static bool IsType(this IMSBuildItem item, string type) 1032private static NuGetVersion GetVersion(IMSBuildItem item) 1051public static void Dump(IEnumerable<IMSBuildItem> items, ILogger log) 1053foreach (var item in items) 1069private static WarningProperties GetWarningProperties(IMSBuildItem specItem) 1078private static RestoreLockProperties GetRestoreLockProperties(IMSBuildItem specItem) 1086private static bool GetRestoreEnableAnalyzerAssets(IMSBuildItem project, IEnumerable<IMSBuildItem> targetFrameworks) 1088foreach (IMSBuildItem targetFramework in targetFrameworks.NoAllocEnumerate()) 1099public static RestoreAuditProperties GetRestoreAuditProperties(IMSBuildItem specItem, IEnumerable<IMSBuildItem> allItems, HashSet<string> suppressionItems) 1123string GetAuditMode(IMSBuildItem project, IEnumerable<IMSBuildItem> tfms) 1125foreach (var item in tfms.NoAllocEnumerate()) 1169private static HashSet<string> GetAuditSuppressions(IEnumerable<IMSBuildItem> items) 1216internal static bool IsPropertyFalse(IMSBuildItem item, string propertyName, bool defaultValue = false) 1228internal static bool IsPropertyTrue(IMSBuildItem item, string propertyName, bool defaultValue = false) 1259private static Dictionary<string, Dictionary<string, CentralPackageVersion>> CreateCentralVersionDependencies(IEnumerable<IMSBuildItem> items, 1263IEnumerable<IMSBuildItem> centralVersions = GetItemByType(items, "CentralPackageVersion")?.Distinct(MSBuildItemIdentityComparer.Default).ToList(); 1266foreach (IMSBuildItem cv in centralVersions) 1302private static ProjectStyle GetProjectStyle(IMSBuildItem projectSpecItem) 1318/// <param name="projectSpecItem">The <see cref="IMSBuildItem" /> to get the central package management settings from.</param> 1321public static (bool IsEnabled, bool IsVersionOverrideDisabled, bool IsCentralPackageTransitivePinningEnabled, bool isCentralPackageFloatingVersionsEnabled) GetCentralPackageManagementSettings(IMSBuildItem projectSpecItem, ProjectStyle projectStyle) 1335private static void AddCentralPackageVersions(PackageSpec spec, IEnumerable<IMSBuildItem> items)
RestoreCommand\Utility\PackageSpecFactory.cs (3)
459/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 529/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param> 793/// <param name="project">The <see cref="IMSBuildItem" /> representing the project.</param>