211 references to LibraryIncludeFlags
Microsoft.Build.NuGetSdkResolver (2)
RestoreRunnerEx.cs (2)
72
SuppressParent =
LibraryIncludeFlags
.All,
74
IncludeType =
LibraryIncludeFlags
.None,
NuGet.Build.Tasks.Console (8)
MSBuildStaticGraphRestore.cs (8)
390
IncludeType = GetLibraryIncludeFlags(packageReferenceItem.GetProperty("IncludeAssets"),
LibraryIncludeFlags
.All) & ~GetLibraryIncludeFlags(packageReferenceItem.GetProperty("ExcludeAssets"),
LibraryIncludeFlags
.None),
482
ExcludeAssets = GetLibraryIncludeFlags(projectReferenceItem.GetProperty("ExcludeAssets"),
LibraryIncludeFlags
.None),
483
IncludeAssets = GetLibraryIncludeFlags(projectReferenceItem.GetProperty("IncludeAssets"),
LibraryIncludeFlags
.All),
690
/// Gets the <see cref="
LibraryIncludeFlags
" /> for the specified value.
694
/// <returns>The <see cref="
LibraryIncludeFlags
" /> for the specified value, otherwise the <paramref name="defaultValue" />.</returns>
695
private static
LibraryIncludeFlags
GetLibraryIncludeFlags(string value,
LibraryIncludeFlags
defaultValue)
NuGet.CommandLine.XPlat (8)
Commands\PackageReferenceCommands\AddPackageReferenceCommandRunner.cs (6)
368
var
includeType = dependency.IncludeType;
369
var
suppressParent = dependency.SuppressParent;
373
includeType ==
LibraryIncludeFlags
.All)
375
suppressParent =
LibraryIncludeFlags
.All;
376
includeType =
LibraryIncludeFlags
.All & ~
LibraryIncludeFlags
.Compile;
Utility\MSBuildAPIUtility.cs (2)
492
if (libraryDependency.IncludeType !=
LibraryIncludeFlags
.All)
690
if (libraryDependency.IncludeType !=
LibraryIncludeFlags
.All)
NuGet.Commands (111)
CommandRunners\PackCommandRunner.cs (8)
324
LibraryIncludeFlags
effectiveInclude = dependency.IncludeType & ~dependency.SuppressParent;
326
if (dependency.IncludeType ==
LibraryIncludeFlags
.None || dependency.SuppressParent ==
LibraryIncludeFlags
.All)
357
if (effectiveInclude ==
LibraryIncludeFlags
.All)
359
includes.Add(
LibraryIncludeFlags
.All.ToString());
361
else if ((effectiveInclude &
LibraryIncludeFlags
.ContentFiles) ==
LibraryIncludeFlags
.ContentFiles)
368
if ((LibraryIncludeFlagUtils.NoContent & ~effectiveInclude) !=
LibraryIncludeFlags
.None)
RestoreCommand\CompatibilityChecker.cs (9)
41
Dictionary<string,
LibraryIncludeFlags
> includeFlags,
103
LibraryIncludeFlags
packageIncludeFlags;
106
packageIncludeFlags =
LibraryIncludeFlags
.All;
113
(
LibraryIncludeFlags
.Compile
114
|
LibraryIncludeFlags
.Runtime)) ==
LibraryIncludeFlags
.None)
159
if ((packageIncludeFlags &
LibraryIncludeFlags
.Runtime) ==
LibraryIncludeFlags
.Runtime)
430
dependencyType:
LibraryIncludeFlags
.All);
RestoreCommand\DependencyGraphResolver.cs (4)
433
if ((childLibraryDependencyIndex != LibraryDependencyIndex.Project && childLibraryDependency.SuppressParent ==
LibraryIncludeFlags
.All)
562
&& childLibraryDependency.SuppressParent !=
LibraryIncludeFlags
.All
595
&& childLibraryDependency.SuppressParent !=
LibraryIncludeFlags
.All
1283
if (dependency.SuppressParent ==
LibraryIncludeFlags
.All)
RestoreCommand\LockFileBuilder.cs (9)
27
private readonly Dictionary<RestoreTargetGraph, Dictionary<string,
LibraryIncludeFlags
>> _includeFlagGraphs;
32
Dictionary<string,
LibraryIncludeFlags
>> includeFlagGraphs)
203
LibraryIncludeFlags
includeFlags;
206
includeFlags = ~
LibraryIncludeFlags
.ContentFiles;
558
Dictionary<string,
LibraryIncludeFlags
> dependenciesIncludeFlags = _includeFlagGraphs[targetGraph];
560
LibraryIncludeFlags
suppressParent =
LibraryIncludeFlags
.All;
570
if (suppressParent ==
LibraryIncludeFlags
.All)
575
if (!dependenciesIncludeFlags.TryGetValue(centralPackageVersion.Name, out
LibraryIncludeFlags
includeType))
RestoreCommand\LockFileBuilderCache.cs (2)
34
private readonly ConcurrentDictionary<(CriteriaKey, string path, string aliases,
LibraryIncludeFlags
, int dependencyCount, bool restoreEnableAnalyzerAssets), Lazy<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)>> _lockFileTargetLibraryCache =
109
internal (LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework) GetLockFileTargetLibrary(RestoreTargetGraph graph, NuGetFramework framework, LocalPackageInfo localPackageInfo, string aliases,
LibraryIncludeFlags
libraryIncludeFlags, List<LibraryDependency> dependencies, bool restoreEnableAnalyzerAssets, Func<(LockFileTargetLibrary, bool, NuGetFramework, NuGetFramework)> valueFactory)
RestoreCommand\RestoreCommand.cs (10)
43
private readonly Dictionary<RestoreTargetGraph, Dictionary<string,
LibraryIncludeFlags
>> _includeFlagGraphs
44
= new Dictionary<RestoreTargetGraph, Dictionary<string,
LibraryIncludeFlags
>>();
514
Dictionary<string,
LibraryIncludeFlags
> flattenedFlags = IncludeFlagUtils.FlattenDependencyTypes(_includeFlagGraphs, project, graph);
532
if (!flattenedFlags.TryGetValue(library.Name, out
LibraryIncludeFlags
includeFlags))
534
includeFlags = ~
LibraryIncludeFlags
.ContentFiles;
537
if ((includeFlags &
LibraryIncludeFlags
.Analyzers) !=
LibraryIncludeFlags
.None)
552
&& (directDependency.IncludeType &
LibraryIncludeFlags
.Analyzers) ==
LibraryIncludeFlags
.None;
1971
Dictionary<RestoreTargetGraph, Dictionary<string,
LibraryIncludeFlags
>> includeFlagGraphs,
RestoreCommand\Utility\IncludeFlagUtils.cs (16)
18
internal static Dictionary<string,
LibraryIncludeFlags
> FlattenDependencyTypes(
19
Dictionary<RestoreTargetGraph, Dictionary<string,
LibraryIncludeFlags
>> includeFlagGraphs,
23
Dictionary<string,
LibraryIncludeFlags
> flattenedFlags;
33
internal static Dictionary<string,
LibraryIncludeFlags
> FlattenDependencyTypes(
37
var result = new Dictionary<string,
LibraryIncludeFlags
>(StringComparer.OrdinalIgnoreCase);
49
LibraryIncludeFlags
includeType = IsDependencyPruned(dependency, specFramework?.PackagesToPrune) ?
50
LibraryIncludeFlags
.None :
79
Dictionary<string,
LibraryIncludeFlags
> result)
110
var
typeIntersection = GetDependencyType(graph, root);
134
LibraryIncludeFlags
currentTypes;
165
&& dependency.SuppressParent !=
LibraryIncludeFlags
.All)
168
LibraryIncludeFlags
typeIntersection =
184
private static
LibraryIncludeFlags
GetDependencyType(
193
var
flags = match.IncludeType;
241
public DependencyNode(GraphItem<RemoteResolveResult> item,
LibraryIncludeFlags
dependencyType)
250
public
LibraryIncludeFlags
DependencyType { get; }
RestoreCommand\Utility\LockFileUtils.cs (29)
35
LibraryIncludeFlags
dependencyType)
68
LibraryIncludeFlags
dependencyType,
198
LibraryIncludeFlags
dependencyType,
360
LibraryIncludeFlags
dependencyType,
379
LibraryIncludeFlags
.Runtime,
388
LibraryIncludeFlags
.Runtime,
397
LibraryIncludeFlags
.Native,
521
LibraryIncludeFlags
dependencyType,
557
&& d.SuppressParent !=
LibraryIncludeFlags
.All
1083
LibraryIncludeFlags
dependencyType,
1084
LibraryIncludeFlags
groupType,
1098
if ((dependencyType & groupType) ==
LibraryIncludeFlags
.None)
1170
public static void ExcludeItems(LockFileTargetLibrary lockFileLib,
LibraryIncludeFlags
dependencyType)
1172
if ((dependencyType &
LibraryIncludeFlags
.Runtime) ==
LibraryIncludeFlags
.None)
1179
if ((dependencyType &
LibraryIncludeFlags
.Compile) ==
LibraryIncludeFlags
.None)
1185
if ((dependencyType &
LibraryIncludeFlags
.Native) ==
LibraryIncludeFlags
.None)
1190
if ((dependencyType &
LibraryIncludeFlags
.Analyzers) ==
LibraryIncludeFlags
.None)
1195
if ((dependencyType &
LibraryIncludeFlags
.ContentFiles) ==
LibraryIncludeFlags
.None
1203
if ((dependencyType &
LibraryIncludeFlags
.BuildTransitive) ==
LibraryIncludeFlags
.None &&
1204
(dependencyType &
LibraryIncludeFlags
.Build) ==
LibraryIncludeFlags
.None)
1210
else if ((dependencyType &
LibraryIncludeFlags
.Build) ==
LibraryIncludeFlags
.None)
RestoreCommand\Utility\MSBuildRestoreUtility.cs (16)
166
public static (
LibraryIncludeFlags
includeType,
LibraryIncludeFlags
suppressParent) GetLibraryDependencyIncludeFlags(string includeAssets, string excludeAssets, string privateAssets)
168
var
includeFlags = GetIncludeFlags(includeAssets,
LibraryIncludeFlags
.All);
169
var
excludeFlags = GetIncludeFlags(excludeAssets,
LibraryIncludeFlags
.None);
171
var
includeType = includeFlags & ~excludeFlags;
172
var
suppressParent = GetIncludeFlags(privateAssets, LibraryIncludeFlagUtils.DefaultSuppressParent);
183
dependency.IncludeAssets = GetIncludeFlags(includeAssets,
LibraryIncludeFlags
.All);
184
dependency.ExcludeAssets = GetIncludeFlags(excludeAssets,
LibraryIncludeFlags
.None);
737
(
var
includeType,
var
suppressParent) = GetLibraryDependencyIncludeFlags(item);
896
private static (
LibraryIncludeFlags
includeType,
LibraryIncludeFlags
suppressParent) GetLibraryDependencyIncludeFlags(IMSBuildItem item)
901
private static
LibraryIncludeFlags
GetIncludeFlags(string value,
LibraryIncludeFlags
defaultValue)
RestoreCommand\Utility\PackageSpecFactory.cs (8)
623
ExcludeAssets = GetLibraryIncludeFlags(projectReferenceItem.GetMetadata("ExcludeAssets"),
LibraryIncludeFlags
.None),
624
IncludeAssets = GetLibraryIncludeFlags(projectReferenceItem.GetMetadata("IncludeAssets"),
LibraryIncludeFlags
.All),
678
IncludeType = GetLibraryIncludeFlags(packageReferenceItem.GetMetadata("IncludeAssets"),
LibraryIncludeFlags
.All) & ~GetLibraryIncludeFlags(packageReferenceItem.GetMetadata("ExcludeAssets"),
LibraryIncludeFlags
.None),
773
/// Gets the <see cref="
LibraryIncludeFlags
" /> for the specified value.
777
/// <returns>The <see cref="
LibraryIncludeFlags
" /> for the specified value, otherwise the <paramref name="defaultValue" />.</returns>
778
private static
LibraryIncludeFlags
GetLibraryIncludeFlags(string? value,
LibraryIncludeFlags
defaultValue)
NuGet.DependencyResolver.Core (4)
PackagingUtility.cs (3)
18
var
includeType = LibraryIncludeFlagUtils.NoContent;
29
var
excludeType = LibraryIncludeFlagUtils.GetFlags(dependency.Exclude);
45
SuppressParent =
LibraryIncludeFlags
.None
Remote\RemoteDependencyWalker.cs (1)
145
|| dependency.SuppressParent !=
LibraryIncludeFlags
.All)
NuGet.LibraryModel (37)
LibraryDependency.cs (5)
20
public
LibraryIncludeFlags
IncludeType { get; init; } =
LibraryIncludeFlags
.All;
22
public
LibraryIncludeFlags
SuppressParent { get; init; } = LibraryIncludeFlagUtils.DefaultSuppressParent;
77
LibraryIncludeFlags
includeType,
78
LibraryIncludeFlags
suppressParent,
LibraryIncludeFlagUtils.cs (32)
19
public static readonly
LibraryIncludeFlags
DefaultSuppressParent =
20
(
LibraryIncludeFlags
.Build |
LibraryIncludeFlags
.ContentFiles |
LibraryIncludeFlags
.Analyzers);
22
public static readonly
LibraryIncludeFlags
NoContent =
LibraryIncludeFlags
.All & ~
LibraryIncludeFlags
.ContentFiles;
27
public static
LibraryIncludeFlags
GetFlags(IEnumerable<string> flags)
34
var
result =
LibraryIncludeFlags
.None;
41
result |=
LibraryIncludeFlags
.All;
44
result |=
LibraryIncludeFlags
.Runtime;
47
result |=
LibraryIncludeFlags
.Compile;
50
result |=
LibraryIncludeFlags
.Build;
53
result |=
LibraryIncludeFlags
.ContentFiles;
56
result |=
LibraryIncludeFlags
.Native;
59
result |=
LibraryIncludeFlags
.Analyzers;
62
result |=
LibraryIncludeFlags
.BuildTransitive |
LibraryIncludeFlags
.Build;
75
public static string GetFlagString(
LibraryIncludeFlags
flags)
77
if (flags ==
LibraryIncludeFlags
.None)
82
if (flags ==
LibraryIncludeFlags
.All)
89
foreach (
LibraryIncludeFlags
value in EnumUtility.GetValues<
LibraryIncludeFlags
>())
91
if (value !=
LibraryIncludeFlags
.None && flags.HasFlag(value))
103
public static
LibraryIncludeFlags
GetFlags(string flags,
LibraryIncludeFlags
defaultFlags)
105
var
result = defaultFlags;
123
private static readonly ConcurrentDictionary<
LibraryIncludeFlags
, string> LibraryIncludeFlagsCache = new();
126
/// Efficiently converts <see cref="
LibraryIncludeFlags
"/> to it's <see cref="string"/> representation.
128
/// <param name="includeFlags">The <see cref="
LibraryIncludeFlags
"/> instance to get the <see cref="string"/> representation for.</param>
130
public static string AsString(this
LibraryIncludeFlags
includeFlags)
NuGet.PackageManagement (10)
BuildIntegratedInstallationContext.cs (3)
37
public
LibraryIncludeFlags
SuppressParent { get; set; } = LibraryIncludeFlagUtils.DefaultSuppressParent;
42
public
LibraryIncludeFlags
IncludeType { get; set; } =
LibraryIncludeFlags
.All;
BuildIntegratedPackageReference.cs (2)
33
developmentDependency: dependency?.SuppressParent ==
LibraryIncludeFlags
.All,
54
developmentDependency: dependency?.SuppressParent ==
LibraryIncludeFlags
.All,
BuildIntegration\BuildIntegratedRestoreUtility.cs (5)
177
dependency.IncludeType ==
LibraryIncludeFlags
.All)
179
var
includeType =
LibraryIncludeFlags
.All & ~
LibraryIncludeFlags
.Compile;
183
SuppressParent =
LibraryIncludeFlags
.All
NuGet.ProjectModel (31)
JsonPackageSpecReader.Utf8JsonStreamReader.cs (17)
211
var
dependencyIncludeFlagsValue =
LibraryIncludeFlags
.All;
212
var
dependencyExcludeFlagsValue =
LibraryIncludeFlags
.None;
213
var
suppressParentFlagsValue = LibraryIncludeFlagUtils.DefaultSuppressParent;
254
var
includeFlags = dependencyIncludeFlagsValue & ~dependencyExcludeFlagsValue;
275
ref
LibraryIncludeFlags
dependencyIncludeFlagsValue,
276
ref
LibraryIncludeFlags
dependencyExcludeFlagsValue,
277
ref
LibraryIncludeFlags
suppressParentFlagsValue,
334
var
dependencyIncludeFlagsValue =
LibraryIncludeFlags
.All;
335
var
dependencyExcludeFlagsValue =
LibraryIncludeFlags
.None;
336
var
suppressParentFlagsValue = LibraryIncludeFlagUtils.DefaultSuppressParent;
462
var
includeFlags = dependencyIncludeFlagsValue & ~dependencyExcludeFlagsValue;
1377
defaultFlags:
LibraryIncludeFlags
.All),
1381
defaultFlags:
LibraryIncludeFlags
.None),
PackageSpecReferenceDependencyProvider.cs (2)
405
SuppressParent = isPruned ?
LibraryIncludeFlags
.All : dependency.SuppressParent,
406
IncludeType = isPruned ?
LibraryIncludeFlags
.None : dependency.IncludeType,
PackageSpecWriter.cs (5)
251
if (project.IncludeAssets !=
LibraryIncludeFlags
.All)
256
if (project.ExcludeAssets !=
LibraryIncludeFlags
.None)
375
var expandedMode = dependency.IncludeType !=
LibraryIncludeFlags
.All
391
if (dependency.IncludeType !=
LibraryIncludeFlags
.All)
471
if (dependency.IncludeType !=
LibraryIncludeFlags
.All)
ProjectLockFile\PackagesLockFileUtilities.cs (3)
259
if (visitedP2PReference.Add(reference.ProjectUniqueName) && reference.PrivateAssets !=
LibraryIncludeFlags
.All)
476
&& dep.SuppressParent !=
LibraryIncludeFlags
.All
479
var transitivelyFlowingProjectReferences = projectRestoreReferences.Where(e => e.PrivateAssets !=
LibraryIncludeFlags
.All);
ProjectRestoreReference.cs (4)
24
public
LibraryIncludeFlags
IncludeAssets { get; set; } =
LibraryIncludeFlags
.All;
26
public
LibraryIncludeFlags
ExcludeAssets { get; set; }
28
public
LibraryIncludeFlags
PrivateAssets { get; set; } = LibraryIncludeFlagUtils.DefaultSuppressParent;