83 references to SharingPolicy
Microsoft.Build (17)
Definition\Project.cs (1)
3715evaluationContext = evaluationContext?.ContextForNewProject() ?? EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated);
Evaluation\Context\EvaluationContext.cs (14)
52internal SharingPolicy Policy { get; } 63private EvaluationContext(SharingPolicy policy, IFileSystem fileSystem, ISdkResolverService sdkResolverService = null, 77/// <param name="policy">The <see cref="SharingPolicy"/> to use.</param> 78public 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"/>. 94public static EvaluationContext Create(SharingPolicy policy, MSBuildFileSystemBase fileSystem) 98policy == SharingPolicy.Shared || fileSystem == null, 115case SharingPolicy.Shared: 117case SharingPolicy.SharedSDKCache: 118case SharingPolicy.Isolated: 125EvaluationContext 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)
3169evaluationContext = 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)] 61public void SharedContextShouldGetReusedWhereasIsolatedContextShouldNot(EvaluationContext.SharingPolicy policy) 77case EvaluationContext.SharingPolicy.Shared: 80case EvaluationContext.SharingPolicy.SharedSDKCache: 83case EvaluationContext.SharingPolicy.Isolated: 106var evaluationContext = EvaluationContext.Create(EvaluationContext.SharingPolicy.Shared, fileSystem); 131[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 132[InlineData(EvaluationContext.SharingPolicy.Isolated)] 133public void NonSharedContextShouldNotSupportBeingPassedAFileSystem(EvaluationContext.SharingPolicy policy) 192[InlineData(EvaluationContext.SharingPolicy.Shared)] 193[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 194[InlineData(EvaluationContext.SharingPolicy.Isolated)] 195public void ReevaluationShouldNotReuseInitialContext(EvaluationContext.SharingPolicy policy) 230[InlineData(EvaluationContext.SharingPolicy.Shared)] 231[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 232[InlineData(EvaluationContext.SharingPolicy.Isolated)] 233public void ProjectInstanceShouldRespectSharingPolicy(EvaluationContext.SharingPolicy policy) 258int 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)] 281public void ContextPinsSdkResolverCache(EvaluationContext.SharingPolicy policy, int sdkLookupsForFoo, int sdkLookupsForBar) 312seenContexts.ShouldAllBe(c => c.Policy == EvaluationContext.SharingPolicy.Isolated); 326EvaluationContext.SharingPolicy.Shared, 336foreach (var policy in new[] { EvaluationContext.SharingPolicy.SharedSDKCache, EvaluationContext.SharingPolicy.Isolated }) 370public void ContextCachesItemElementGlobExpansions(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 400EvaluationContext.SharingPolicy.Shared, 410foreach (var policy in new[] { EvaluationContext.SharingPolicy.SharedSDKCache, EvaluationContext.SharingPolicy.Isolated }) 429public void ContextDisambiguatesSameRelativeGlobsPointingInsideDifferentProjectCones(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 479public void ContextDisambiguatesSameRelativeGlobsPointingOutsideDifferentProjectCones(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 536public void ContextDisambiguatesAFullyQualifiedGlobPointingInAnotherRelativeGlobsCone(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 538if (policy == EvaluationContext.SharingPolicy.Shared) 606public void ContextDisambiguatesDistinctRelativeGlobsPointingOutsideOfSameProjectCone(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 667public void ContextCachesCommonOutOfProjectConeFullyQualifiedGlob(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 675public void ContextCachesCommonOutOfProjectConeRelativeGlob(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 680private void ContextCachesCommonOutOfProjectCone(bool itemSpecPathIsRelative, EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 755public void ContextCachesImportGlobExpansions(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 795[InlineData(EvaluationContext.SharingPolicy.Isolated)] 796[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 797[InlineData(EvaluationContext.SharingPolicy.Shared)] 798public void ContextCachesExistenceChecksInConditions(EvaluationContext.SharingPolicy policy) 829case EvaluationContext.SharingPolicy.Shared: 832case EvaluationContext.SharingPolicy.SharedSDKCache: 833case EvaluationContext.SharingPolicy.Isolated: 844[InlineData(EvaluationContext.SharingPolicy.Isolated)] 845[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 846[InlineData(EvaluationContext.SharingPolicy.Shared)] 847public void ContextCachesExistenceChecksInGetDirectoryNameOfFileAbove(EvaluationContext.SharingPolicy policy) 875case EvaluationContext.SharingPolicy.Shared: 878case EvaluationContext.SharingPolicy.SharedSDKCache: 879case EvaluationContext.SharingPolicy.Isolated: 900[InlineData(EvaluationContext.SharingPolicy.Isolated)] 901[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 902[InlineData(EvaluationContext.SharingPolicy.Shared)] 903public void ContextCachesExistenceChecksInGetPathOfFileAbove(EvaluationContext.SharingPolicy policy) 931case EvaluationContext.SharingPolicy.Shared: 934case EvaluationContext.SharingPolicy.SharedSDKCache: 935case EvaluationContext.SharingPolicy.Isolated:
Graph\ProjectGraph_Tests.cs (1)
115EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated));
InternalEngineHelpers.cs (1)
29var context = EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated);