2 instantiations of ContentItem
NuGet.Packaging (2)
ContentModel\Infrastructure\Parser.cs (2)
89
item = new
ContentItem
209
item = new
ContentItem
75 references to ContentItem
dotnet (1)
ToolPackage\ToolPackageDownloader.cs (1)
247
foreach (
var
item in group.Items)
Microsoft.DotNet.Build.Tasks.Packaging (4)
NuGetAssetResolver.cs (4)
102
foreach (
var
contentItem in contentGroup.Items)
230
foreach (
var
packageAsset in packageAssets.Items)
299
foreach (
var
packageAsset in packageAssets.Items)
316
foreach (
var
packageAsset in packageAssets.Items)
Microsoft.DotNet.PackageTesting (4)
Package.cs (4)
27
IEnumerable<
ContentItem
> RefAssets = packageAssets.FindItems(conventions.Patterns.CompileRefAssemblies);
28
IEnumerable<
ContentItem
> LibAssets = packageAssets.FindItems(conventions.Patterns.CompileLibAssemblies);
29
IEnumerable<
ContentItem
> CompileAssets = RefAssets.Any() ? RefAssets : LibAssets;
32
IEnumerable<
ContentItem
> RuntimeAssets = packageAssets.FindItems(conventions.Patterns.RuntimeAssemblies);
Microsoft.DotNet.PackageValidation (41)
ApiCompatRunnerExtensions.cs (3)
19
IReadOnlyList<
ContentItem
> leftContentItems,
20
IReadOnlyList<
ContentItem
> rightContentItems,
76
ContentItem
item,
ContentItemEqualityComparer.cs (4)
8
internal class ContentItemEqualityComparer : IEqualityComparer<
ContentItem
>
16
public bool Equals(
ContentItem
? x,
ContentItem
? y) => string.Equals(x?.Path, y?.Path);
18
public int GetHashCode(
ContentItem
obj) => obj.Path.GetHashCode();
Package.cs (18)
41
public IEnumerable<
ContentItem
> PackageAssets { get; }
46
public IEnumerable<
ContentItem
> CompileAssets { get; }
51
public IEnumerable<
ContentItem
> RefAssets { get; }
56
public IEnumerable<
ContentItem
> LibAssets { get; }
61
public IEnumerable<
ContentItem
> RuntimeSpecificAssets { get; }
66
public IEnumerable<
ContentItem
> RuntimeAssets { get; }
149
public IReadOnlyList<
ContentItem
>? FindBestRuntimeAssetForFramework(NuGetFramework framework)
152
IList<
ContentItem
>? items = _contentItemCollection.FindBestItemGroup(managedCriteria,
156
new ReadOnlyCollection<
ContentItem
>(items.Where(t => !t.Path.StartsWith("runtimes")).ToArray()) :
165
public IReadOnlyList<
ContentItem
>? FindBestRuntimeSpecificAssetForFramework(NuGetFramework framework)
168
IList<
ContentItem
>? items = _contentItemCollection.FindBestItemGroup(managedCriteria,
172
new ReadOnlyCollection<
ContentItem
>(items.Where(t => t.Path.StartsWith("runtimes")).ToArray()) :
182
public IReadOnlyList<
ContentItem
>? FindBestRuntimeAssetForFrameworkAndRuntime(NuGetFramework framework, string rid)
185
IList<
ContentItem
>? items = _contentItemCollection.FindBestItemGroup(managedCriteria,
189
new ReadOnlyCollection<
ContentItem
>(items) :
198
public IReadOnlyList<
ContentItem
>? FindBestCompileAssetForFramework(NuGetFramework framework)
204
IList<
ContentItem
>? items = _contentItemCollection.FindBestItemGroup(managedCriteria, patternSet)?.Items;
207
new ReadOnlyCollection<
ContentItem
>(items) :
Validators\BaselinePackageValidator.cs (8)
41
IReadOnlyList<
ContentItem
>? baselineCompileAssets = options.BaselinePackage.FindBestCompileAssetForFramework(baselineTargetFramework);
45
IReadOnlyList<
ContentItem
>? latestCompileAssets = options.Package.FindBestCompileAssetForFramework(baselineTargetFramework);
65
IReadOnlyList<
ContentItem
>? baselineRuntimeAssets = options.BaselinePackage.FindBestRuntimeAssetForFramework(baselineTargetFramework);
69
IReadOnlyList<
ContentItem
>? latestRuntimeAssets = options.Package.FindBestRuntimeAssetForFramework(baselineTargetFramework);
89
IReadOnlyList<
ContentItem
>? baselineRuntimeSpecificAssets = options.BaselinePackage.FindBestRuntimeSpecificAssetForFramework(baselineTargetFramework);
92
IEnumerable<IGrouping<string,
ContentItem
>> baselineRuntimeSpecificAssetsRidGroupedPerRid = baselineRuntimeSpecificAssets
96
foreach (IGrouping<string,
ContentItem
> baselineRuntimeSpecificAssetsRidGroup in baselineRuntimeSpecificAssetsRidGroupedPerRid)
98
IReadOnlyList<
ContentItem
>? latestRuntimeSpecificAssets = options.Package.FindBestRuntimeAssetForFrameworkAndRuntime(baselineTargetFramework, baselineRuntimeSpecificAssetsRidGroup.Key);
Validators\CompatibleFrameworkInPackageValidator.cs (5)
39
Queue<(NuGetFramework, IReadOnlyList<
ContentItem
>)> compileAssetsQueue = new();
42
IReadOnlyList<
ContentItem
>? compileTimeAsset = options.Package.FindBestCompileAssetForFramework(framework);
49
(NuGetFramework framework, IReadOnlyList<
ContentItem
> compileTimeAsset) = compileAssetsQueue.Dequeue();
61
IList<
ContentItem
>? compatibleFrameworkAsset = contentItemCollection.FindBestItemGroup(managedCriteria, patternSet)?.Items;
65
new ReadOnlyCollection<
ContentItem
>(compatibleFrameworkAsset),
Validators\CompatibleTFMValidator.cs (3)
41
IReadOnlyList<
ContentItem
>? compileTimeAsset = options.Package.FindBestCompileAssetForFramework(framework);
51
IReadOnlyList<
ContentItem
>? runtimeAsset = options.Package.FindBestRuntimeAssetForFramework(framework);
71
IReadOnlyList<
ContentItem
>? runtimeRidSpecificAsset = options.Package.FindBestRuntimeAssetForFrameworkAndRuntime(framework, rid);
NuGet.Commands (3)
RestoreCommand\ContentFiles\ContentFileUtils.cs (1)
92
foreach (
var
item in group.Items.NoAllocEnumerate())
RestoreCommand\Utility\LockFileUtils.cs (2)
695
foreach (
var
item in group.Items.NoAllocEnumerate())
986
foreach (
var
item in group.Items.NoAllocEnumerate())
NuGet.Packaging (22)
ContentModel\ContentItemCollection.cs (12)
20
private static readonly SimplePool<Dictionary<
ContentItem
, List<Asset>>> GroupAssetsPool = new(() => new(GroupComparer.DefaultComparer));
64
public IEnumerable<
ContentItem
> FindItems(PatternSet definition)
74
return Enumerable.Empty<
ContentItem
>();
96
Dictionary<
ContentItem
, List<Asset>>? groupAssets = null;
101
var
item = groupPattern.Match(asset.Path, definition.PropertyDefinitions);
248
private List<
ContentItem
> FindItemsImplementation(PatternSet definition, IEnumerable<Asset> assets)
252
List<
ContentItem
> items = new();
260
var
contentItem = pathPattern.Match(path, definition.PropertyDefinitions);
370
internal class GroupComparer : IEqualityComparer<
ContentItem
>
374
public int GetHashCode(
ContentItem
obj)
431
public bool Equals(
ContentItem
? x,
ContentItem
? y)
ContentModel\ContentItemGroup.cs (3)
15
Items = new List<
ContentItem
>();
18
internal ContentItemGroup(IDictionary<string, object> properties, IList<
ContentItem
> items)
26
public IList<
ContentItem
> Items { get; }
ContentModel\Infrastructure\Parser.cs (5)
67
internal
ContentItem
? Match(string path, IReadOnlyDictionary<string, ContentPropertyDefinition> propertyDefinitions)
69
ContentItem
? item = null;
110
internal abstract bool TryMatch(ref
ContentItem
? item, string path, IReadOnlyDictionary<string, ContentPropertyDefinition> propertyDefinitions, int startIndex, out int endIndex);
128
ref
ContentItem
? item,
171
ref
ContentItem
? item,
PackageCreation\Authoring\PackageBuilder.cs (1)
757
foreach (
ContentItem
item in group.Items.NoAllocEnumerate())
Rules\InvalidUndottedFrameworkRule.cs (1)
226
foreach (
ContentItem
item in group.Items.NoAllocEnumerate())