83 references to SharingPolicy
Microsoft.Build (17)
Definition\Project.cs (1)
3715
evaluationContext = evaluationContext?.ContextForNewProject() ?? EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Isolated);
Evaluation\Context\EvaluationContext.cs (14)
52
internal
SharingPolicy
Policy { get; }
63
private EvaluationContext(
SharingPolicy
policy, IFileSystem fileSystem, ISdkResolverService sdkResolverService = null,
77
/// <param name="policy">The <see cref="
SharingPolicy
"/> to use.</param>
78
public static EvaluationContext Create(
SharingPolicy
policy)
87
/// <param name="policy">The <see cref="
SharingPolicy
"/> to use.</param>
89
/// This parameter is compatible only with <see cref="
SharingPolicy
.Shared"/>.
90
/// The method throws if a file system is used with <see cref="
SharingPolicy
.Isolated"/> or <see cref="
SharingPolicy
.SharedSDKCache"/>.
94
public static EvaluationContext Create(
SharingPolicy
policy, MSBuildFileSystemBase fileSystem)
98
policy ==
SharingPolicy
.Shared || fileSystem == null,
115
case
SharingPolicy
.Shared:
117
case
SharingPolicy
.SharedSDKCache:
118
case
SharingPolicy
.Isolated:
125
EvaluationContext context = new EvaluationContext(Policy, fileSystem: null, sdkResolverService: Policy ==
SharingPolicy
.SharedSDKCache ? SdkResolverService : null)
Graph\ProjectGraph.cs (1)
430
_evaluationContext = EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Shared);
Instance\ProjectInstance.cs (1)
3169
evaluationContext = evaluationContext?.ContextForNewProject() ?? EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Isolated);
Microsoft.Build.Engine.UnitTests (66)
Definition\ProjectEvaluationContext_Tests.cs (64)
58
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
59
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
60
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
61
public void SharedContextShouldGetReusedWhereasIsolatedContextShouldNot(EvaluationContext.
SharingPolicy
policy)
77
case EvaluationContext.
SharingPolicy
.Shared:
80
case EvaluationContext.
SharingPolicy
.SharedSDKCache:
83
case EvaluationContext.
SharingPolicy
.Isolated:
106
var evaluationContext = EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Shared, fileSystem);
131
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
132
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
133
public void NonSharedContextShouldNotSupportBeingPassedAFileSystem(EvaluationContext.
SharingPolicy
policy)
192
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
193
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
194
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
195
public void ReevaluationShouldNotReuseInitialContext(EvaluationContext.
SharingPolicy
policy)
230
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
231
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
232
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
233
public void ProjectInstanceShouldRespectSharingPolicy(EvaluationContext.
SharingPolicy
policy)
258
int expectedNumContexts = policy == EvaluationContext.
SharingPolicy
.Shared ? 1 : numIterations;
278
[InlineData(EvaluationContext.
SharingPolicy
.Shared, 1, 1)]
279
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache, 1, 1)]
280
[InlineData(EvaluationContext.
SharingPolicy
.Isolated, 4, 4)]
281
public void ContextPinsSdkResolverCache(EvaluationContext.
SharingPolicy
policy, int sdkLookupsForFoo, int sdkLookupsForBar)
312
seenContexts.ShouldAllBe(c => c.Policy == EvaluationContext.
SharingPolicy
.Isolated);
326
EvaluationContext.
SharingPolicy
.Shared,
336
foreach (
var
policy in new[] { EvaluationContext.
SharingPolicy
.SharedSDKCache, EvaluationContext.
SharingPolicy
.Isolated })
370
public void ContextCachesItemElementGlobExpansions(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
400
EvaluationContext.
SharingPolicy
.Shared,
410
foreach (
var
policy in new[] { EvaluationContext.
SharingPolicy
.SharedSDKCache, EvaluationContext.
SharingPolicy
.Isolated })
429
public void ContextDisambiguatesSameRelativeGlobsPointingInsideDifferentProjectCones(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
479
public void ContextDisambiguatesSameRelativeGlobsPointingOutsideDifferentProjectCones(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
536
public void ContextDisambiguatesAFullyQualifiedGlobPointingInAnotherRelativeGlobsCone(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
538
if (policy == EvaluationContext.
SharingPolicy
.Shared)
606
public void ContextDisambiguatesDistinctRelativeGlobsPointingOutsideOfSameProjectCone(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
667
public void ContextCachesCommonOutOfProjectConeFullyQualifiedGlob(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
675
public void ContextCachesCommonOutOfProjectConeRelativeGlob(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
680
private void ContextCachesCommonOutOfProjectCone(bool itemSpecPathIsRelative, EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
755
public void ContextCachesImportGlobExpansions(EvaluationContext.
SharingPolicy
policy, string[][] expectedGlobExpansions)
795
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
796
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
797
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
798
public void ContextCachesExistenceChecksInConditions(EvaluationContext.
SharingPolicy
policy)
829
case EvaluationContext.
SharingPolicy
.Shared:
832
case EvaluationContext.
SharingPolicy
.SharedSDKCache:
833
case EvaluationContext.
SharingPolicy
.Isolated:
844
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
845
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
846
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
847
public void ContextCachesExistenceChecksInGetDirectoryNameOfFileAbove(EvaluationContext.
SharingPolicy
policy)
875
case EvaluationContext.
SharingPolicy
.Shared:
878
case EvaluationContext.
SharingPolicy
.SharedSDKCache:
879
case EvaluationContext.
SharingPolicy
.Isolated:
900
[InlineData(EvaluationContext.
SharingPolicy
.Isolated)]
901
[InlineData(EvaluationContext.
SharingPolicy
.SharedSDKCache)]
902
[InlineData(EvaluationContext.
SharingPolicy
.Shared)]
903
public void ContextCachesExistenceChecksInGetPathOfFileAbove(EvaluationContext.
SharingPolicy
policy)
931
case EvaluationContext.
SharingPolicy
.Shared:
934
case EvaluationContext.
SharingPolicy
.SharedSDKCache:
935
case EvaluationContext.
SharingPolicy
.Isolated:
Graph\ProjectGraph_Tests.cs (1)
115
EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Isolated));
InternalEngineHelpers.cs (1)
29
var context = EvaluationContext.Create(EvaluationContext.
SharingPolicy
.Isolated);