167 references to BuildComponentType
Microsoft.Build (167)
BackEnd\BuildManager\BuildManager.cs (25)
377private ISdkResolverService SdkResolverService => ((this as IBuildComponentHost).GetComponent(BuildComponentType.SdkResolverService) as ISdkResolverService)!; 383ILoggingService IBuildComponentHost.LoggingService => _componentFactories.GetComponent<ILoggingService>(BuildComponentType.LoggingService); 607NodeLauncher nodeLauncher = ((IBuildComponentHost)this).GetComponent<NodeLauncher>(BuildComponentType.NodeLauncher); 627_nodeManager = ((IBuildComponentHost)this).GetComponent(BuildComponentType.NodeManager) as INodeManager; 682_taskHostNodeManager = ((IBuildComponentHost)this).GetComponent<INodeManager>(BuildComponentType.TaskHostNodeManager); 683_scheduler = ((IBuildComponentHost)this).GetComponent<IScheduler>(BuildComponentType.Scheduler); 774_configCache = ((IBuildComponentHost)this).GetComponent<IConfigCache>(BuildComponentType.ConfigCache); 775_resultsCache = ((IBuildComponentHost)this).GetComponent<IResultsCache>(BuildComponentType.ResultsCache); 932_configCache = ((IBuildComponentHost)this).GetComponent<IConfigCache>(BuildComponentType.ConfigCache); 933_resultsCache = ((IBuildComponentHost)this).GetComponent<IResultsCache>(BuildComponentType.ResultsCache); 953_configCache = ((IBuildComponentHost)this).GetComponent(BuildComponentType.ConfigCache) as IConfigCache; 1451_nodeManager ??= (INodeManager)((IBuildComponentHost)this).GetComponent(BuildComponentType.NodeManager); 1491void IBuildComponentHost.RegisterFactory(BuildComponentType componentType, BuildComponentFactoryDelegate factory) 1501IBuildComponent IBuildComponentHost.GetComponent(BuildComponentType type) 1506TComponent IBuildComponentHost.GetComponent<TComponent>(BuildComponentType type) 2770ILoggingService loggingService = ((IBuildComponentHost)this).GetComponent<ILoggingService>(BuildComponentType.LoggingService); 2783ILoggingService loggingService = ((IBuildComponentHost)this).GetComponent<ILoggingService>(BuildComponentType.LoggingService); 2957IConfigCache configCache = _componentFactories.GetComponent<IConfigCache>(BuildComponentType.ConfigCache); 3055ILoggingService loggingService = ((IBuildComponentHost)this).GetComponent<ILoggingService>(BuildComponentType.LoggingService); 3206_componentFactories.ReplaceFactory(BuildComponentType.LoggingService, loggingService as IBuildComponent); 3219((IBuildComponentHost)this).GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider; 3424_componentFactories.ShutdownComponent(BuildComponentType.LoggingService); 3431_componentFactories.ReplaceFactory(BuildComponentType.LoggingService, (IBuildComponent?)null); 3532_componentFactories.ReplaceFactory(BuildComponentType.ConfigCache, new ConfigCacheWithOverride(cacheAggregation.ConfigCache)); 3533_componentFactories.ReplaceFactory(BuildComponentType.ResultsCache, new ResultsCacheWithOverride(cacheAggregation.ResultsCache));
BackEnd\Components\BuildComponentFactoryCollection.cs (48)
25private readonly Dictionary<BuildComponentType, BuildComponentEntry> _componentEntriesByType; 38_componentEntriesByType = new Dictionary<BuildComponentType, BuildComponentEntry>(); 62_componentEntriesByType[BuildComponentType.Scheduler] = new BuildComponentEntry(BuildComponentType.Scheduler, Scheduler.CreateComponent, CreationPattern.Singleton); 63_componentEntriesByType[BuildComponentType.ConfigCache] = new BuildComponentEntry(BuildComponentType.ConfigCache, ConfigCache.CreateComponent, CreationPattern.Singleton); 64_componentEntriesByType[BuildComponentType.ResultsCache] = new BuildComponentEntry(BuildComponentType.ResultsCache, ResultsCache.CreateComponent, CreationPattern.Singleton); 65_componentEntriesByType[BuildComponentType.NodeManager] = new BuildComponentEntry(BuildComponentType.NodeManager, NodeManager.CreateComponent, CreationPattern.Singleton); 66_componentEntriesByType[BuildComponentType.TaskHostNodeManager] = new BuildComponentEntry(BuildComponentType.TaskHostNodeManager, TaskHostNodeManager.CreateComponent, CreationPattern.Singleton); 68_componentEntriesByType[BuildComponentType.NodeLauncher] = new BuildComponentEntry(BuildComponentType.NodeLauncher, NodeLauncher.CreateComponent, CreationPattern.Singleton); 69_componentEntriesByType[BuildComponentType.InProcNodeProvider] = new BuildComponentEntry(BuildComponentType.InProcNodeProvider, NodeProviderInProc.CreateComponent, CreationPattern.Singleton); 70_componentEntriesByType[BuildComponentType.OutOfProcNodeProvider] = new BuildComponentEntry(BuildComponentType.OutOfProcNodeProvider, NodeProviderOutOfProc.CreateComponent, CreationPattern.Singleton); 71_componentEntriesByType[BuildComponentType.OutOfProcTaskHostNodeProvider] = new BuildComponentEntry(BuildComponentType.OutOfProcTaskHostNodeProvider, NodeProviderOutOfProcTaskHost.CreateComponent, CreationPattern.Singleton); 76_componentEntriesByType[BuildComponentType.RequestEngine] = new BuildComponentEntry(BuildComponentType.RequestEngine, BuildRequestEngine.CreateComponent, CreationPattern.Singleton); 80_componentEntriesByType[BuildComponentType.LoggingService] = new BuildComponentEntry(BuildComponentType.LoggingService, null); 81_componentEntriesByType[BuildComponentType.RequestBuilder] = new BuildComponentEntry(BuildComponentType.RequestBuilder, RequestBuilder.CreateComponent, CreationPattern.CreateAlways); 83_componentEntriesByType[BuildComponentType.BuildCheckManagerProvider] = new BuildComponentEntry(BuildComponentType.BuildCheckManagerProvider, BuildCheckManagerProvider.CreateComponent, CreationPattern.Singleton); 84_componentEntriesByType[BuildComponentType.TelemetryCollector] = new BuildComponentEntry(BuildComponentType.TelemetryCollector, TelemetryCollectorProvider.CreateComponent, CreationPattern.Singleton); 85_componentEntriesByType[BuildComponentType.TargetBuilder] = new BuildComponentEntry(BuildComponentType.TargetBuilder, TargetBuilder.CreateComponent, CreationPattern.CreateAlways); 86_componentEntriesByType[BuildComponentType.TaskBuilder] = new BuildComponentEntry(BuildComponentType.TaskBuilder, TaskBuilder.CreateComponent, CreationPattern.CreateAlways); 87_componentEntriesByType[BuildComponentType.RegisteredTaskObjectCache] = new BuildComponentEntry(BuildComponentType.RegisteredTaskObjectCache, RegisteredTaskObjectCache.CreateComponent, CreationPattern.Singleton); 90_componentEntriesByType[BuildComponentType.SdkResolverService] = new BuildComponentEntry(BuildComponentType.SdkResolverService, MainNodeSdkResolverService.CreateComponent, CreationPattern.Singleton); 102foreach (KeyValuePair<BuildComponentType, BuildComponentEntry> componentEntry in _componentEntriesByType) 114public void ShutdownComponent(BuildComponentType componentType) 125public void ReplaceFactory(BuildComponentType componentType, BuildComponentFactoryDelegate factory) 136public void ReplaceFactory(BuildComponentType componentType, IBuildComponent instance) 148public void AddFactory(BuildComponentType componentType, BuildComponentFactoryDelegate factory, CreationPattern creationPattern) 158public IBuildComponent GetComponent(BuildComponentType type) 165internal TComponent GetComponent<TComponent>(BuildComponentType type) where TComponent : IBuildComponent 188public BuildComponentEntry(BuildComponentType type, BuildComponentFactoryDelegate factory, CreationPattern pattern) 198public BuildComponentEntry(BuildComponentType type, IBuildComponent singleton) 208private BuildComponentType ComponentType { get; }
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (14)
228var telemetryProvider = (TelemetryCollectorProvider)_componentHost.GetComponent(BuildComponentType.TelemetryCollector); 322IBuildCheckManagerProvider buildCheckProvider = (_componentHost.GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider); 380IResultsCache cache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 383BuildRequestConfiguration config = ((IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache))[request.ConfigurationId]; 487IResultsCache resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 488IConfigCache configCache = (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache); 573IConfigCache globalConfigurations = (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache); 583IResultsCache resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 653_configCache = (IConfigCache)host.GetComponent(BuildComponentType.ConfigCache); 679internal static IBuildComponent CreateComponent(BuildComponentType type) 681Assumed.Equal(type, BuildComponentType.RequestEngine, $"Cannot create component of type {type}"); 1003IRequestBuilder builder = (IRequestBuilder)_componentHost.GetComponent(BuildComponentType.RequestBuilder); 1180IConfigCache globalConfigCache = (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache); 1267IResultsCache resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache);
BackEnd\Components\Caching\ConfigCache.cs (2)
335internal static IBuildComponent CreateComponent(BuildComponentType componentType) 337Assumed.Equal(componentType, BuildComponentType.ConfigCache, $"Cannot create components of type {componentType}");
BackEnd\Components\Caching\RegisteredTaskObjectCache.cs (2)
57internal static IBuildComponent CreateComponent(BuildComponentType type) 59Assumed.Equal(type, BuildComponentType.RegisteredTaskObjectCache, $"Cannot create components of type {type}");
BackEnd\Components\Caching\ResultsCache.cs (2)
296internal static IBuildComponent CreateComponent(BuildComponentType componentType) 298Assumed.Equal(componentType, BuildComponentType.ResultsCache, $"Cannot create components of type {componentType}");
BackEnd\Components\Communications\NodeLauncher.cs (2)
33public static IBuildComponent CreateComponent(BuildComponentType type) 35ArgumentOutOfRangeException.ThrowIfNotEqual(type, BuildComponentType.NodeLauncher);
BackEnd\Components\Communications\NodeManager.cs (4)
169_inProcNodeProvider = _componentHost.GetComponent(BuildComponentType.InProcNodeProvider) as INodeProvider; 170_outOfProcNodeProvider = _componentHost.GetComponent(BuildComponentType.OutOfProcNodeProvider) as INodeProvider; 282internal static IBuildComponent CreateComponent(BuildComponentType type) 284Assumed.Equal(type, BuildComponentType.NodeManager, $"Cannot create component of type {type}");
BackEnd\Components\Communications\NodeProviderInProc.cs (2)
335internal static IBuildComponent CreateComponent(BuildComponentType type) 337Assumed.Equal(type, BuildComponentType.InProcNodeProvider, $"Cannot create component of type {type}");
BackEnd\Components\Communications\NodeProviderOutOfProc.cs (2)
198internal static IBuildComponent CreateComponent(BuildComponentType componentType) 200Assumed.Equal(componentType, BuildComponentType.OutOfProcNodeProvider, $"Factory cannot create components of type {componentType}");
BackEnd\Components\Communications\NodeProviderOutOfProcBase.cs (1)
390INodeLauncher nodeLauncher = (INodeLauncher)_componentHost.GetComponent(BuildComponentType.NodeLauncher);
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (2)
388internal static IBuildComponent CreateComponent(BuildComponentType componentType) 390Assumed.Equal(componentType, BuildComponentType.OutOfProcTaskHostNodeProvider, $"Factory cannot create components of type {componentType}");
BackEnd\Components\Communications\TaskHostNodeManager.cs (3)
92_outOfProcTaskHostNodeProvider = _componentHost.GetComponent(BuildComponentType.OutOfProcTaskHostNodeProvider) as INodeProvider; 176internal static IBuildComponent CreateComponent(BuildComponentType type) 178Assumed.Equal(type, BuildComponentType.TaskHostNodeManager, $"Cannot create component of type {type}");
BackEnd\Components\IBuildComponentHost.cs (4)
17internal delegate IBuildComponent BuildComponentFactoryDelegate(BuildComponentType type); 194void RegisterFactory(BuildComponentType factoryType, BuildComponentFactoryDelegate factory); 201IBuildComponent GetComponent(BuildComponentType type); 209TComponent GetComponent<TComponent>(BuildComponentType type)
BackEnd\Components\Logging\LoggingService.cs (2)
317_configCache = new Lazy<IConfigCache>(() => (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache), LazyThreadSafetyMode.PublicationOnly); 912_buildEngineDataRouter = (buildComponentHost.GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider)?.BuildEngineDataRouter;
BackEnd\Components\Logging\LoggingServiceFactory.cs (2)
46public IBuildComponent CreateInstance(BuildComponentType type) 48Assumed.Equal(type, BuildComponentType.LoggingService, $"Cannot create components of type {type}");
BackEnd\Components\RequestBuilder\RequestBuilder.cs (6)
216_targetBuilder = (ITargetBuilder)_componentHost.GetComponent(BuildComponentType.TargetBuilder); 632internal static IBuildComponent CreateComponent(BuildComponentType type) 634Assumed.Equal(type, BuildComponentType.RequestBuilder, $"Cannot create components of type {type}"); 1139: (_componentHost.GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider)!.Instance; 1276var resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 1311IResultsCache resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache);
BackEnd\Components\RequestBuilder\TargetBuilder.cs (5)
138IResultsCache resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 170ITaskBuilder taskBuilder = _componentHost.GetComponent(BuildComponentType.TaskBuilder) as ITaskBuilder; 266ITaskBuilder taskBuilder = _componentHost.GetComponent(BuildComponentType.TaskBuilder) as ITaskBuilder; 395internal static IBuildComponent CreateComponent(BuildComponentType type) 397Assumed.Equal(type, BuildComponentType.TargetBuilder, $"Cannot create components of type {type}");
BackEnd\Components\RequestBuilder\TaskBuilder.cs (2)
241internal static IBuildComponent CreateComponent(BuildComponentType type) 243Assumed.Equal(type, BuildComponentType.TaskBuilder, $"Cannot create components of type {type}");
BackEnd\Components\RequestBuilder\TaskHost.cs (3)
620var objectCache = (IRegisteredTaskObjectCache)_host.GetComponent(BuildComponentType.RegisteredTaskObjectCache); 629var objectCache = (IRegisteredTaskObjectCache)_host.GetComponent(BuildComponentType.RegisteredTaskObjectCache); 638var objectCache = (IRegisteredTaskObjectCache)_host.GetComponent(BuildComponentType.RegisteredTaskObjectCache);
BackEnd\Components\Scheduler\Scheduler.cs (4)
690_resultsCache = (IResultsCache)_componentHost.GetComponent(BuildComponentType.ResultsCache); 691_configCache = (IConfigCache)_componentHost.GetComponent(BuildComponentType.ConfigCache); 708internal static IBuildComponent CreateComponent(BuildComponentType componentType) 710Assumed.Equal(componentType, BuildComponentType.Scheduler, $"Cannot create components of type {componentType}");
BackEnd\Components\SdkResolution\MainNodeSdkResolverService.cs (6)
25/// must have access to an <see cref="IBuildComponentHost"/> and call <see cref="IBuildComponentHost.GetComponent"/> and pass <see cref="BuildComponentType.SdkResolverService"/>. 34public static IBuildComponent CreateComponent(BuildComponentType type) 36ArgumentOutOfRangeException.ThrowIfNotEqual(type, BuildComponentType.SdkResolverService); 75ILoggingService loggingService = Host.GetComponent(BuildComponentType.LoggingService) as ILoggingService; 83ILoggingService loggingService = Host.GetComponent(BuildComponentType.LoggingService) as ILoggingService; 92INodeManager nodeManager = Host.GetComponent(BuildComponentType.NodeManager) as INodeManager;
BackEnd\Components\SdkResolution\OutOfProcNodeSdkResolverService.cs (1)
25/// must have access to an <see cref="IBuildComponentHost"/> and call <see cref="IBuildComponentHost.GetComponent"/> and pass <see cref="BuildComponentType.SdkResolverService"/>.
BackEnd\Components\SdkResolution\OutOfProcNodeSdkResolverServiceFactory.cs (1)
24public IBuildComponent CreateInstance(BuildComponentType type)
BackEnd\Node\InProcNode.cs (2)
120IBuildComponent buildRequestEngine = BuildRequestEngine.CreateComponent(BuildComponentType.RequestEngine); 334IRegisteredTaskObjectCache objectCache = (IRegisteredTaskObjectCache)(_componentHost.GetComponent(BuildComponentType.RegisteredTaskObjectCache));
BackEnd\Node\OutOfProcNode.cs (13)
155_buildRequestEngine = (this as IBuildComponentHost).GetComponent(BuildComponentType.RequestEngine) as IBuildRequestEngine; 156_globalConfigCache = (this as IBuildComponentHost).GetComponent(BuildComponentType.ConfigCache) as IConfigCache; 157_taskHostNodeManager = (this as IBuildComponentHost).GetComponent(BuildComponentType.TaskHostNodeManager) as INodeManager; 161((IBuildComponentHost)this).RegisterFactory(BuildComponentType.SdkResolverService, sdkResolverServiceFactory.CreateInstance); 162_sdkResolverService = (this as IBuildComponentHost).GetComponent(BuildComponentType.SdkResolverService) as ISdkResolverService; 295void IBuildComponentHost.RegisterFactory(BuildComponentType factoryType, BuildComponentFactoryDelegate factory) 305IBuildComponent IBuildComponentHost.GetComponent(BuildComponentType type) 310TComponent IBuildComponentHost.GetComponent<TComponent>(BuildComponentType type) 481IRegisteredTaskObjectCache objectCache = (IRegisteredTaskObjectCache)(_componentFactories.GetComponent(BuildComponentType.RegisteredTaskObjectCache)); 556if (_componentFactories.GetComponent(BuildComponentType.ConfigCache) is IConfigCache configCache) 561if (_componentFactories.GetComponent(BuildComponentType.ResultsCache) is IResultsCache resultsCache) 777_componentFactories.ReplaceFactory(BuildComponentType.LoggingService, loggingServiceFactory.CreateInstance); 779_loggingService = _componentFactories.GetComponent(BuildComponentType.LoggingService) as ILoggingService;
BackEnd\Shared\BuildRequestConfiguration.cs (1)
493ISdkResolverService sdkResolverService = componentHost.GetComponent(BuildComponentType.SdkResolverService) as ISdkResolverService;
BuildCheck\Infrastructure\BuildCheckManagerProvider.cs (2)
34internal static IBuildComponent CreateComponent(BuildComponentType type) 36Assumed.Equal(type, BuildComponentType.BuildCheckManagerProvider, $"Cannot create components of type {type}");
BuildCheck\Infrastructure\BuildCheckReplayModeConnector.cs (1)
30.GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider;
Instance\TaskFactories\TaskHostTask.cs (1)
317_taskHostProvider = (NodeProviderOutOfProcTaskHost)_buildComponentHost.GetComponent(BuildComponentType.OutOfProcTaskHostNodeProvider);
TelemetryInfra\TelemetryCollectorProvider.cs (2)
28internal static IBuildComponent CreateComponent(BuildComponentType type) 30Assumed.Equal(type, BuildComponentType.TelemetryCollector, $"Cannot create components of type {type}");