3 instantiations of EvaluationContext
Microsoft.Build (3)
Evaluation\Context\EvaluationContext.cs (3)
101var context = new EvaluationContext( 125EvaluationContext context = new EvaluationContext(Policy, fileSystem: null, sdkResolverService: Policy == SharingPolicy.SharedSDKCache ? SdkResolverService : null) 145return new EvaluationContext(Policy, fileSystem, SdkResolverService, FileEntryExpansionCache)
215 references to EvaluationContext
Microsoft.Build (92)
Definition\Project.cs (40)
265EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive) 359EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive) 455EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive) 932public List<GlobResult> GetAllGlobs(EvaluationContext evaluationContext) 954public List<GlobResult> GetAllGlobs(string itemType, EvaluationContext evaluationContext) 1016public List<ProvenanceResult> GetItemProvenance(string itemToMatch, EvaluationContext evaluationContext) 1040public List<ProvenanceResult> GetItemProvenance(string itemToMatch, string itemType, EvaluationContext evaluationContext) 1070public List<ProvenanceResult> GetItemProvenance(ProjectItem item, EvaluationContext evaluationContext) 1386public ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 1418/// <param name="evaluationContext">The <see cref="EvaluationContext"/> to use. See <see cref="EvaluationContext"/>.</param> 1419public void ReevaluateIfNecessary(EvaluationContext evaluationContext) 1637public bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, EvaluationContext evaluationContext) 1904public ProjectImpl(Project owner, XmlReader xmlReader, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 1939public ProjectImpl(Project owner, string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) 2502/// See <see cref="ProjectLink.GetAllGlobs(EvaluationContext)"/>. 2508public override List<GlobResult> GetAllGlobs(EvaluationContext evaluationContext) 2514/// See <see cref="ProjectLink.GetAllGlobs(string, EvaluationContext)"/>. 2521public override List<GlobResult> GetAllGlobs(string itemType, EvaluationContext evaluationContext) 2681/// See <see cref="ProjectLink.GetItemProvenance(string, EvaluationContext)"/>. 2688public override List<ProvenanceResult> GetItemProvenance(string itemToMatch, EvaluationContext evaluationContext) 2694/// See <see cref="ProjectLink.GetItemProvenance(string, string, EvaluationContext)"/>. 2702public override List<ProvenanceResult> GetItemProvenance(string itemToMatch, string itemType, EvaluationContext evaluationContext) 2708/// See <see cref="ProjectLink.GetItemProvenance(ProjectItem, EvaluationContext)"/>. 2719public override List<ProvenanceResult> GetItemProvenance(ProjectItem item, EvaluationContext evaluationContext) 2739private List<ProjectItemElement> GetEvaluatedItemElements(EvaluationContext evaluationContext) 3268/// See <see cref="ProjectLink.CreateProjectInstance(ProjectInstanceSettings, EvaluationContext)"/>. 3273public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 3301/// <param name="evaluationContext">The <see cref="EvaluationContext"/> to use. See <see cref="EvaluationContext"/>.</param> 3302public override void ReevaluateIfNecessary(EvaluationContext evaluationContext) 3329public override bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, EvaluationContext evaluationContext) 3668private void ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext = null) 3679EvaluationContext evaluationContext = null) 3703EvaluationContext evaluationContext) 3713EvaluationContext evaluationContext = null) 3715evaluationContext = evaluationContext?.ContextForNewProject() ?? EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated); 3766internal void Initialize(IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, bool interactive) 4264public void InitializeForEvaluation(IToolsetProvider toolsetProvider, EvaluationContext evaluationContext, LoggingContext loggingContext)
Definition\ProjectOptions.cs (1)
46public EvaluationContext EvaluationContext { get; set; }
Evaluation\Context\EvaluationContext.cs (13)
29/// Instructs the <see cref="EvaluationContext"/> to reuse all cached state between the different project evaluations that use it. 34/// Instructs the <see cref="EvaluationContext"/> to not reuse any cached state between the different project evaluations that use it. 39/// Instructs the <see cref="EvaluationContext"/> to reuse SDK resolver cache between the different project evaluations that use it. 50internal static Action<EvaluationContext> TestOnlyHookOnCreate { get; set; } 75/// Factory for <see cref="EvaluationContext" /> 78public static EvaluationContext Create(SharingPolicy policy) 85/// Factory for <see cref="EvaluationContext" /> 94public static EvaluationContext Create(SharingPolicy policy, MSBuildFileSystemBase fileSystem) 101var context = new EvaluationContext( 110internal EvaluationContext ContextForNewProject() 125EvaluationContext context = new EvaluationContext(Policy, fileSystem: null, sdkResolverService: Policy == SharingPolicy.SharedSDKCache ? SdkResolverService : null) 139/// Creates a copy of this <see cref="EvaluationContext"/> with a given <see cref="IFileSystem"/> swapped in. 143internal EvaluationContext ContextWithFileSystem(IFileSystem fileSystem)
Evaluation\Evaluator.cs (3)
154private readonly EvaluationContext _evaluationContext; 210EvaluationContext evaluationContext, 312EvaluationContext evaluationContext,
Evaluation\Expander.cs (4)
319internal EvaluationContext EvaluationContext { get; } 353internal Expander(IPropertyProvider<P> properties, EvaluationContext evaluationContext, 376internal Expander(IPropertyProvider<P> properties, IItemProvider<I> items, EvaluationContext evaluationContext, LoggingContext loggingContext) 412EvaluationContext evaluationContext,
Evaluation\IEvaluatorData.cs (1)
216void InitializeForEvaluation(IToolsetProvider toolsetProvider, EvaluationContext evaluationContext, LoggingContext loggingContext);
Evaluation\LazyItemEvaluator.cs (2)
46protected EvaluationContext EvaluationContext { get; } 52public LazyItemEvaluator(IEvaluatorData<P, I, M, D> data, IItemFactory<I, I> itemFactory, LoggingContext loggingContext, EvaluationProfiler evaluationProfiler, EvaluationContext evaluationContext)
Evaluation\LazyItemEvaluator.EvaluatorData.cs (1)
294public void InitializeForEvaluation(IToolsetProvider toolsetProvider, EvaluationContext evaluationContext, LoggingContext loggingContext)
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (1)
151public void InitializeForEvaluation(IToolsetProvider toolsetProvider, EvaluationContext evaluationContext, LoggingContext loggingContext) => _wrapped.InitializeForEvaluation(toolsetProvider, evaluationContext, loggingContext);
Graph\ProjectGraph.cs (4)
62private readonly EvaluationContext _evaluationContext = null; 430_evaluationContext = EvaluationContext.Create(EvaluationContext.SharingPolicy.Shared); 853EvaluationContext evaluationContext)
Instance\ProjectInstance.cs (7)
271internal ProjectInstance(string projectFile, IDictionary<string, string> globalProperties, string toolsVersion, string subToolsetVersion, ProjectCollection projectCollection, EvaluationContext context, bool interactive = false) 295ProjectLoadSettings? projectLoadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive) 513ProjectLoadSettings? projectLoadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, bool interactive) 1686InitializeForEvaluation(IToolsetProvider toolsetProvider, EvaluationContext evaluationContext, LoggingContext loggingContext) 3081EvaluationContext evaluationContext = null, 3169evaluationContext = evaluationContext?.ContextForNewProject() ?? EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated);
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (15)
134/// Facilitate remoting the <see cref="Project.GetAllGlobs(EvaluationContext)"/>. 136public abstract List<GlobResult> GetAllGlobs(EvaluationContext evaluationContext); 139/// Facilitate remoting the <see cref="Project.GetAllGlobs(string, EvaluationContext)"/>. 141public abstract List<GlobResult> GetAllGlobs(string itemType, EvaluationContext evaluationContext); 144/// Facilitate remoting the <see cref="Project.GetItemProvenance(string, EvaluationContext)"/>. 146public abstract List<ProvenanceResult> GetItemProvenance(string itemToMatch, EvaluationContext evaluationContext); 149/// Facilitate remoting the <see cref="Project.GetItemProvenance(string, string, EvaluationContext)"/>. 151public abstract List<ProvenanceResult> GetItemProvenance(string itemToMatch, string itemType, EvaluationContext evaluationContext); 154/// Facilitate remoting the <see cref="Project.GetItemProvenance(ProjectItem, EvaluationContext)"/>. 156public abstract List<ProvenanceResult> GetItemProvenance(ProjectItem item, EvaluationContext evaluationContext); 234/// Facilitate remoting the <see cref="Project.CreateProjectInstance(ProjectInstanceSettings, EvaluationContext)"/>. 236public abstract ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext); 244/// Facilitate remoting the <see cref="Project.ReevaluateIfNecessary(EvaluationContext)"/>. 246public abstract void ReevaluateIfNecessary(EvaluationContext evaluationContext); 256public abstract bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, EvaluationContext evaluationContext);
Microsoft.Build.Engine.OM.UnitTests (9)
ObjectModelRemoting\RemoteProjectsProviderMock\EvaluationLinkMocks\MockProjectLink.cs (9)
94public void ReevaluateIfNecessary(EvaluationContext evaluationContext) => this.Source.ReevaluateIfNecessary(evaluationContext); 183public override bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, EvaluationContext evaluationContext) 185public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) => throw new NotImplementedException(); 191public override List<GlobResult> GetAllGlobs(EvaluationContext evaluationContext) 196public override List<GlobResult> GetAllGlobs(string itemType, EvaluationContext evaluationContext) 201public override List<ProvenanceResult> GetItemProvenance(string itemToMatch, EvaluationContext evaluationContext) 206public override List<ProvenanceResult> GetItemProvenance(string itemToMatch, string itemType, EvaluationContext evaluationContext) 211public override List<ProvenanceResult> GetItemProvenance(ProjectItem item, EvaluationContext evaluationContext) 231public override void ReevaluateIfNecessary(EvaluationContext evaluationContext) => this.Proxy.ReevaluateIfNecessary(evaluationContext);
Microsoft.Build.Engine.UnitTests (114)
BackEnd\SdkResultOutOfProc_Tests.cs (2)
89EvaluationContext.TestOnlyHookOnCreate = null; 266EvaluationContext.TestOnlyHookOnCreate = context =>
Definition\ProjectEvaluationContext_Tests.cs (107)
50private static void SetResolverForContext(EvaluationContext context, SdkResolver resolver) 58[InlineData(EvaluationContext.SharingPolicy.Shared)] 59[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 60[InlineData(EvaluationContext.SharingPolicy.Isolated)] 61public void SharedContextShouldGetReusedWhereasIsolatedContextShouldNot(EvaluationContext.SharingPolicy policy) 63var previousContext = EvaluationContext.Create(policy); 67var currentContext = previousContext.ContextForNewProject(); 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) 136Should.Throw<ArgumentException>(() => EvaluationContext.Create(policy, fileSystem)); 192[InlineData(EvaluationContext.SharingPolicy.Shared)] 193[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 194[InlineData(EvaluationContext.SharingPolicy.Isolated)] 195public void ReevaluationShouldNotReuseInitialContext(EvaluationContext.SharingPolicy policy) 199EvaluationContext.TestOnlyHookOnCreate = c => SetResolverForContext(c, _resolver); 203var context = EvaluationContext.Create(policy); 225EvaluationContext.TestOnlyHookOnCreate = null; 230[InlineData(EvaluationContext.SharingPolicy.Shared)] 231[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 232[InlineData(EvaluationContext.SharingPolicy.Isolated)] 233public void ProjectInstanceShouldRespectSharingPolicy(EvaluationContext.SharingPolicy policy) 237var seenContexts = new HashSet<EvaluationContext>(); 239EvaluationContext.TestOnlyHookOnCreate = c => seenContexts.Add(c); 243var context = EvaluationContext.Create(policy); 258int expectedNumContexts = policy == EvaluationContext.SharingPolicy.Shared ? 1 : numIterations; 265EvaluationContext.TestOnlyHookOnCreate = null; 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) 285EvaluationContext.TestOnlyHookOnCreate = c => SetResolverForContext(c, _resolver); 287var context = EvaluationContext.Create(policy); 296EvaluationContext.TestOnlyHookOnCreate = null; 305var seenContexts = new HashSet<EvaluationContext>(); 307EvaluationContext.TestOnlyHookOnCreate = c => seenContexts.Add(c); 312seenContexts.ShouldAllBe(c => c.Policy == EvaluationContext.SharingPolicy.Isolated); 316EvaluationContext.TestOnlyHookOnCreate = null; 326EvaluationContext.SharingPolicy.Shared, 336foreach (var policy in new[] { EvaluationContext.SharingPolicy.SharedSDKCache, EvaluationContext.SharingPolicy.Isolated }) 370public void ContextCachesItemElementGlobExpansions(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 374var context = EvaluationContext.Create(policy); 400EvaluationContext.SharingPolicy.Shared, 410foreach (var policy in new[] { EvaluationContext.SharingPolicy.SharedSDKCache, EvaluationContext.SharingPolicy.Isolated }) 429public void ContextDisambiguatesSameRelativeGlobsPointingInsideDifferentProjectCones(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 434var context = EvaluationContext.Create(policy); 479public void ContextDisambiguatesSameRelativeGlobsPointingOutsideDifferentProjectCones(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 489var context = EvaluationContext.Create(policy); 536public void ContextDisambiguatesAFullyQualifiedGlobPointingInAnotherRelativeGlobsCone(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 538if (policy == EvaluationContext.SharingPolicy.Shared) 551var context = EvaluationContext.Create(policy); 606public void ContextDisambiguatesDistinctRelativeGlobsPointingOutsideOfSameProjectCone(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 618var context = EvaluationContext.Create(policy); 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) 722var context = EvaluationContext.Create(policy); 755public void ContextCachesImportGlobExpansions(EvaluationContext.SharingPolicy policy, string[][] expectedGlobExpansions) 759var context = EvaluationContext.Create(policy); 795[InlineData(EvaluationContext.SharingPolicy.Isolated)] 796[InlineData(EvaluationContext.SharingPolicy.SharedSDKCache)] 797[InlineData(EvaluationContext.SharingPolicy.Shared)] 798public void ContextCachesExistenceChecksInConditions(EvaluationContext.SharingPolicy policy) 802var context = EvaluationContext.Create(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) 849var context = EvaluationContext.Create(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) 905var context = EvaluationContext.Create(policy); 931case EvaluationContext.SharingPolicy.Shared: 934case EvaluationContext.SharingPolicy.SharedSDKCache: 935case EvaluationContext.SharingPolicy.Isolated: 955private void EvaluateProjects(IEnumerable<string> projectContents, EvaluationContext context, Action<Project> afterEvaluationAction) 984private void EvaluateProjects(IEnumerable<ProjectSpecification> projectSpecs, EvaluationContext context, Action<Project> afterEvaluationAction)
Graph\ProjectGraph_Tests.cs (2)
115EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated));
InternalEngineHelpers.cs (3)
29var context = EvaluationContext.Create(EvaluationContext.SharingPolicy.Isolated);