5 instantiations of CacheResult
Microsoft.Build (5)
BackEnd\Components\ProjectCache\CacheResult.cs (5)
82return new CacheResult(CacheResultType.CacheHit, buildResult); 87return new CacheResult(CacheResultType.CacheHit, proxyTargets: proxyTargets); 94return new CacheResult(CacheResultType.CacheHit, ConstructBuildResult(targetResults)); 100return new CacheResult(resultType); 105return new CacheResult(e);
50 references to CacheResult
Microsoft.Build (15)
BackEnd\BuildManager\BuildManager.cs (1)
2324internal void PostCacheResult(CacheRequest cacheRequest, CacheResult cacheResult, int projectContextId)
BackEnd\Components\ProjectCache\CacheResult.cs (5)
80public static CacheResult IndicateCacheHit(BuildResult buildResult) 85public static CacheResult IndicateCacheHit(ProxyTargets proxyTargets) 90public static CacheResult IndicateCacheHit(IReadOnlyCollection<PluginTargetResult> targetResults) 97public static CacheResult IndicateNonCacheHit(CacheResultType resultType) 103internal static CacheResult IndicateException(Exception e)
BackEnd\Components\ProjectCache\ProjectCachePluginBase.cs (1)
34public abstract Task<CacheResult> GetCacheResultAsync(
BackEnd\Components\ProjectCache\ProjectCacheService.cs (8)
442(CacheResult cacheResult, int projectContextId) = await ProcessCacheRequestAsync(); 447_buildManager.PostCacheResult(cacheRequest, CacheResult.IndicateException(e), BuildEventContext.InvalidProjectContextId); 452async ValueTask<(CacheResult Result, int ProjectContextId)> ProcessCacheRequestAsync() 465CacheResult cacheResult; 473cacheResult = CacheResult.IndicateException(ex); 502private async ValueTask<CacheResult> GetCacheResultAsync(BuildRequestData buildRequest, BuildRequestConfiguration buildRequestConfiguration, BuildEventContext buildEventContext, CancellationToken cancellationToken) 525CacheResult? cacheResult = null; 572cacheResult ??= CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable);
Microsoft.Build.Engine.UnitTests (33)
ProjectCache\ProjectCacheTests.cs (33)
99public Dictionary<int, CacheResult> NonCacheMissResults { get; } 101public GraphCacheResponse(Dictionary<int, int[]?> graphEdges, Dictionary<int, CacheResult>? nonCacheMissResults = null, IDictionary<int, string>? extraContentPerProjectNumber = null) 105NonCacheMissResults = nonCacheMissResults ?? new Dictionary<int, CacheResult>(); 115public static CacheResult SuccessfulProxyTargetResult() 117return CacheResult.IndicateCacheHit( 125public static CacheResult SuccessfulTargetResult(int projectNumber, string projectPath) 127return CacheResult.IndicateCacheHit( 146public CacheResult GetExpectedCacheResultForNode(ProjectGraphNode node) 151public CacheResult GetExpectedCacheResultForProjectNumber(int projectNumber) 153return NonCacheMissResults.TryGetValue(projectNumber, out var cacheResult) 155: CacheResult.IndicateNonCacheHit(CacheResultType.CacheMiss); 178var cacheResult = GetExpectedCacheResultForProjectNumber(projectNumber); 196private readonly Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> _getCacheResultDelegate; 198public DelegatingMockCache(Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> getCacheResultDelegate) 208public override async Task<CacheResult> GetCacheResultAsync(BuildRequestData buildRequest, PluginLoggerBase logger, CancellationToken cancellationToken) 237public Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>>? GetCacheResultImplementation { get; set; } 246public override Task<CacheResult> GetCacheResultAsync( 253: Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 289public override async Task<CacheResult> GetCacheResultAsync( 311?? CacheResult.IndicateNonCacheHit(CacheResultType.CacheMiss); 323public CacheResult GetCacheResultForNode(ProjectGraphNode node) 348new Dictionary<int, CacheResult> 358new Dictionary<int, CacheResult> 374new Dictionary<int, CacheResult> 384new Dictionary<int, CacheResult> 394new Dictionary<int, CacheResult> 735new Dictionary<int, CacheResult> 808var expectedCacheResponse = testData.GetExpectedCacheResultForNode(node); 840CacheResult expectedCacheResponse) 970new Dictionary<int, CacheResult> 9732, CacheResult.IndicateCacheHit( 1599return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 1605CacheResult.IndicateCacheHit(
ProjectCachePlugin (2)
AssemblyMockCache.cs (2)
43public override Task<CacheResult> GetCacheResultAsync( 54return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable));