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)
2302internal 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 Task<(CacheResult Result, int ProjectContextId)> ProcessCacheRequestAsync() 465CacheResult cacheResult; 473cacheResult = CacheResult.IndicateException(ex); 502private async Task<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)
101public Dictionary<int, CacheResult> NonCacheMissResults { get; } 103public GraphCacheResponse(Dictionary<int, int[]?> graphEdges, Dictionary<int, CacheResult>? nonCacheMissResults = null, IDictionary<int, string>? extraContentPerProjectNumber = null) 107NonCacheMissResults = nonCacheMissResults ?? new Dictionary<int, CacheResult>(); 117public static CacheResult SuccessfulProxyTargetResult() 119return CacheResult.IndicateCacheHit( 127public static CacheResult SuccessfulTargetResult(int projectNumber, string projectPath) 129return CacheResult.IndicateCacheHit( 148public CacheResult GetExpectedCacheResultForNode(ProjectGraphNode node) 153public CacheResult GetExpectedCacheResultForProjectNumber(int projectNumber) 155return NonCacheMissResults.TryGetValue(projectNumber, out var cacheResult) 157: CacheResult.IndicateNonCacheHit(CacheResultType.CacheMiss); 180var cacheResult = GetExpectedCacheResultForProjectNumber(projectNumber); 198private readonly Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> _getCacheResultDelegate; 200public DelegatingMockCache(Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>> getCacheResultDelegate) 210public override async Task<CacheResult> GetCacheResultAsync(BuildRequestData buildRequest, PluginLoggerBase logger, CancellationToken cancellationToken) 239public Func<BuildRequestData, PluginLoggerBase, CancellationToken, Task<CacheResult>>? GetCacheResultImplementation { get; set; } 248public override Task<CacheResult> GetCacheResultAsync( 255: Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 291public override async Task<CacheResult> GetCacheResultAsync( 313?? CacheResult.IndicateNonCacheHit(CacheResultType.CacheMiss); 325public CacheResult GetCacheResultForNode(ProjectGraphNode node) 350new Dictionary<int, CacheResult> 360new Dictionary<int, CacheResult> 376new Dictionary<int, CacheResult> 386new Dictionary<int, CacheResult> 396new Dictionary<int, CacheResult> 737new Dictionary<int, CacheResult> 810var expectedCacheResponse = testData.GetExpectedCacheResultForNode(node); 842CacheResult expectedCacheResponse) 972new Dictionary<int, CacheResult> 9752, CacheResult.IndicateCacheHit( 1601return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable)); 1607CacheResult.IndicateCacheHit(
ProjectCachePlugin (2)
AssemblyMockCache.cs (2)
43public override Task<CacheResult> GetCacheResultAsync( 54return Task.FromResult(CacheResult.IndicateNonCacheHit(CacheResultType.CacheNotApplicable));