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