5 instantiations of CacheResult
Microsoft.Build (5)
BackEnd\Components\ProjectCache\CacheResult.cs (5)
82
return new
CacheResult
(CacheResultType.CacheHit, buildResult);
87
return new
CacheResult
(CacheResultType.CacheHit, proxyTargets: proxyTargets);
94
return new
CacheResult
(CacheResultType.CacheHit, ConstructBuildResult(targetResults));
100
return new
CacheResult
(resultType);
105
return new
CacheResult
(e);
50 references to CacheResult
Microsoft.Build (15)
BackEnd\BuildManager\BuildManager.cs (1)
2260
internal void PostCacheResult(CacheRequest cacheRequest,
CacheResult
cacheResult, int projectContextId)
BackEnd\Components\ProjectCache\CacheResult.cs (5)
80
public static
CacheResult
IndicateCacheHit(BuildResult buildResult)
85
public static
CacheResult
IndicateCacheHit(ProxyTargets proxyTargets)
90
public static
CacheResult
IndicateCacheHit(IReadOnlyCollection<PluginTargetResult> targetResults)
97
public static
CacheResult
IndicateNonCacheHit(CacheResultType resultType)
103
internal static
CacheResult
IndicateException(Exception e)
BackEnd\Components\ProjectCache\ProjectCachePluginBase.cs (1)
34
public abstract Task<
CacheResult
> GetCacheResultAsync(
BackEnd\Components\ProjectCache\ProjectCacheService.cs (8)
441
(
CacheResult
cacheResult, int projectContextId) = await ProcessCacheRequestAsync();
446
_buildManager.PostCacheResult(cacheRequest,
CacheResult
.IndicateException(e), BuildEventContext.InvalidProjectContextId);
451
async Task<(
CacheResult
Result, int ProjectContextId)> ProcessCacheRequestAsync()
464
CacheResult
cacheResult;
472
cacheResult =
CacheResult
.IndicateException(ex);
501
private async Task<
CacheResult
> GetCacheResultAsync(BuildRequestData buildRequest, BuildRequestConfiguration buildRequestConfiguration, BuildEventContext buildEventContext, CancellationToken cancellationToken)
524
CacheResult
? cacheResult = null;
571
cacheResult ??=
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheNotApplicable);
Microsoft.Build.Engine.UnitTests (33)
ProjectCache\ProjectCacheTests.cs (33)
98
public Dictionary<int,
CacheResult
> NonCacheMissResults { get; }
100
public GraphCacheResponse(Dictionary<int, int[]?> graphEdges, Dictionary<int,
CacheResult
>? nonCacheMissResults = null, IDictionary<int, string>? extraContentPerProjectNumber = null)
104
NonCacheMissResults = nonCacheMissResults ?? new Dictionary<int,
CacheResult
>();
114
public static
CacheResult
SuccessfulProxyTargetResult()
116
return
CacheResult
.IndicateCacheHit(
124
public static
CacheResult
SuccessfulTargetResult(int projectNumber, string projectPath)
126
return
CacheResult
.IndicateCacheHit(
145
public
CacheResult
GetExpectedCacheResultForNode(ProjectGraphNode node)
150
public
CacheResult
GetExpectedCacheResultForProjectNumber(int projectNumber)
152
return NonCacheMissResults.TryGetValue(projectNumber, out
var
cacheResult)
154
:
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheMiss);
177
var
cacheResult = GetExpectedCacheResultForProjectNumber(projectNumber);
195
private readonly Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<
CacheResult
>> _getCacheResultDelegate;
197
public DelegatingMockCache(Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<
CacheResult
>> getCacheResultDelegate)
207
public override async Task<
CacheResult
> GetCacheResultAsync(BuildRequestData buildRequest, PluginLoggerBase logger, CancellationToken cancellationToken)
236
public Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<
CacheResult
>>? GetCacheResultImplementation { get; set; }
245
public override Task<
CacheResult
> GetCacheResultAsync(
252
: Task.FromResult(
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheNotApplicable));
288
public override async Task<
CacheResult
> GetCacheResultAsync(
310
??
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheMiss);
322
public
CacheResult
GetCacheResultForNode(ProjectGraphNode node)
347
new Dictionary<int,
CacheResult
>
357
new Dictionary<int,
CacheResult
>
373
new Dictionary<int,
CacheResult
>
383
new Dictionary<int,
CacheResult
>
393
new Dictionary<int,
CacheResult
>
734
new Dictionary<int,
CacheResult
>
807
var
expectedCacheResponse = testData.GetExpectedCacheResultForNode(node);
839
CacheResult
expectedCacheResponse)
969
new Dictionary<int,
CacheResult
>
972
2,
CacheResult
.IndicateCacheHit(
1598
return Task.FromResult(
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheNotApplicable));
1604
CacheResult
.IndicateCacheHit(
ProjectCachePlugin (2)
AssemblyMockCache.cs (2)
43
public override Task<
CacheResult
> GetCacheResultAsync(
54
return Task.FromResult(
CacheResult
.IndicateNonCacheHit(CacheResultType.CacheNotApplicable));