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