9 instantiations of TaskRegistry
Microsoft.Build (7)
Definition\Project.cs (1)
4324TaskRegistry = new TaskRegistry(Toolset, Project.ProjectCollection.ProjectRootElementCache);
Definition\Toolset.cs (2)
875_defaultTaskRegistry = new TaskRegistry(projectRootElementCache); 981_overrideTaskRegistry = new TaskRegistry(projectRootElementCache);
Instance\ProjectInstance.cs (3)
401this.TaskRegistry = new TaskRegistry(Toolset, project.ProjectCollection.ProjectRootElementCache); 477TaskRegistry = new TaskRegistry(Toolset, linkedProject.ProjectCollection.ProjectRootElementCache); 3142this.TaskRegistry = new TaskRegistry(this.Toolset, ProjectRootElementCache);
Instance\TaskRegistry.cs (1)
1867var instance = new TaskRegistry();
Microsoft.Build.Engine.UnitTests (2)
BackEnd\TaskRegistry_Tests.cs (2)
2183? new TaskRegistry(toolset, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache) 2184: new TaskRegistry(ProjectCollection.GlobalProjectCollection.ProjectRootElementCache);
179 references to TaskRegistry
Microsoft.Build (22)
Definition\Project.cs (1)
4168public TaskRegistry TaskRegistry { get; set; }
Definition\Toolset.cs (6)
166private TaskRegistry _defaultTaskRegistry; 171private TaskRegistry _overrideTaskRegistry; 824internal TaskRegistry GetTaskRegistry(LoggingContext loggingContext, ProjectRootElementCacheBase projectRootElementCache) 850internal TaskRegistry GetOverrideTaskRegistry(LoggingContext loggingContext, ProjectRootElementCacheBase projectRootElementCache) 1033private void LoadAndRegisterFromTasksFile(string[] defaultTaskFiles, LoggingContext loggingContext, string taskFileError, ProjectRootElementCacheBase projectRootElementCache, TaskRegistry registry) 1038TaskRegistry.InitializeTaskRegistryFromUsingTaskElements<ProjectPropertyInstance, ProjectItemInstance>(
Evaluation\Evaluator.cs (1)
731TaskRegistry.InitializeTaskRegistryFromUsingTaskElements<P, I>(
Evaluation\IEvaluatorData.cs (1)
53TaskRegistry TaskRegistry
Evaluation\LazyItemEvaluator.EvaluatorData.cs (1)
203public TaskRegistry TaskRegistry
Evaluation\PropertyTrackingEvaluatorDataWrapper.cs (1)
133public TaskRegistry TaskRegistry { get => _wrapped.TaskRegistry; set => _wrapped.TaskRegistry = value; }
Instance\ProjectInstance.cs (4)
186private TaskRegistry _taskRegistry; 1281TaskRegistry IEvaluatorData<ProjectPropertyInstance, ProjectItemInstance, ProjectMetadataInstance, ProjectItemDefinitionInstance>.TaskRegistry 1581internal TaskRegistry TaskRegistry 2420translator.Translate(ref _taskRegistry, TaskRegistry.FactoryForDeserialization);
Instance\TaskRegistry.cs (7)
255TaskRegistry taskRegistry, 275taskRegistry._taskRegistrations ??= TaskRegistry.CreateRegisteredTaskDictionary(); 289TaskRegistry taskRegistry, 547TaskRegistry toolsetRegistry = _toolset.GetOverrideTaskRegistry(targetLoggingContext, RootElementCache); 606TaskRegistry toolsetRegistry = _toolset.GetTaskRegistry(targetLoggingContext, RootElementCache); 1865public static TaskRegistry FactoryForDeserialization(ITranslator translator) 1867var instance = new TaskRegistry();
Microsoft.Build.Engine.UnitTests (157)
BackEnd\TaskRegistry_Tests.cs (112)
110TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 117List<TaskRegistry.RegisteredTaskRecord> registrationRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(taskElement.TaskName, null)]; 150TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 157List<TaskRegistry.RegisteredTaskRecord> registrationRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(taskElement.TaskName, null)]; 192TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 201List<TaskRegistry.RegisteredTaskRecord> singletonBucket = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(elementList[1].TaskName, null)]; 210List<TaskRegistry.RegisteredTaskRecord> duplicateBucket = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(elementList[0].TaskName, null)]; 216foreach (TaskRegistry.RegisteredTaskRecord record in duplicateBucket) 257TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 264List<TaskRegistry.RegisteredTaskRecord> registrationRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(taskElement.TaskName, null)]; 296TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 335TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 359TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 395TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 433TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 471TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 509TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 576TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 622TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 705TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 778TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 835TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 949TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 992TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1054TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1125TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1130IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1143List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(expandedtaskName, null)]; 1181TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1186IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1198List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity(expandedtaskName, null)]; 1219TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1224IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1227List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Hello", null)]; 1245TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1272TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1276IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1279List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)]; 1282TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord inlineTaskRecord = registeredTaskRecords[0].ParameterGroupAndTaskBody; 1308TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1312IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1315List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)]; 1319TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord inlineTaskRecord = registeredTaskRecords[0].ParameterGroupAndTaskBody; 1350TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1351Assert.True(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"].PropertyType.Equals(typeof(String))); 1365TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1366Assert.True(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"].PropertyType.Equals(typeof(String))); 1425TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1471TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1489TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1560TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1575TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1576Assert.False(((TaskPropertyInfo)registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"]).Output); 1590TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1591Assert.False(((TaskPropertyInfo)registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"]).Output); 1622TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1623Assert.False(((TaskPropertyInfo)registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"]).Required); 1637TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1638Assert.False(((TaskPropertyInfo)registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"]).Required); 1681TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1685IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registeredTasks = registry.TaskRegistrations; 1688List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)]; 1692TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord inlineTaskRecord = registeredTaskRecords[0].ParameterGroupAndTaskBody; 1735TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1737List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)]; 1740TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord inlineTaskRecord = registeredTaskRecords[0].ParameterGroupAndTaskBody; 1759TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1761List<TaskRegistry.RegisteredTaskRecord> registeredTaskRecords = registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)]; 1764TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord inlineTaskRecord = registeredTaskRecords[0].ParameterGroupAndTaskBody; 1777TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1780Assert.False(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.TaskBodyEvaluated.Equals(body)); 1795TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1798Assert.False(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.TaskBodyEvaluated.Equals(expandedBody)); 1823TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1824Assert.False(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.TaskBodyEvaluated); 1835TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1836Assert.True(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.TaskBodyEvaluated); 1847TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 1848Assert.True(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.TaskBodyEvaluated); 1981var original = CreateTaskRegistryAndRegisterTasks(usingTaskElements, toolset); 1985var copy = TaskRegistry.FactoryForDeserialization(TranslationHelpers.GetReadTranslator()); 2002TaskRegistry registry, 2044TaskRegistry registry, 2072private void RetrieveAndValidateRegisteredTaskRecord(TaskRegistry registry, bool exactMatchRequired, Dictionary<string, string> taskParameters, bool shouldBeRetrieved, bool shouldBeRetrievedFromCache) 2094private void RetrieveAndValidateRegisteredTaskRecord(TaskRegistry registry, bool exactMatchRequired, string runtime, string architecture, bool shouldBeRetrieved, bool shouldBeRetrievedFromCache) 2111TaskRegistry registry = CreateTaskRegistryAndRegisterTasks(elementList); 2128Assert.True(registry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("Name", null)][0].ParameterGroupAndTaskBody.UsingTaskParameters["ParameterWithAllAttributesHardCoded"].PropertyType.Equals(paramType)); 2172internal static int GetDeepCountOfRegisteredTasks(IDictionary<TaskRegistry.RegisteredTaskIdentity, List<TaskRegistry.RegisteredTaskRecord>> registryRecords) 2180internal TaskRegistry CreateTaskRegistryAndRegisterTasks(List<ProjectUsingTaskElement> usingTaskElements, Toolset toolset = null) 2182TaskRegistry registry = toolset != null 2187TaskRegistry.InitializeTaskRegistryFromUsingTaskElements(
Definition\ToolsVersion_Tests.cs (27)
41TaskRegistry taskRegistry = (TaskRegistry)t.GetTaskRegistry(loggingContext, e.ProjectRootElementCache); 42TaskRegistry taskoverrideRegistry = (TaskRegistry)t.GetOverrideTaskRegistry(loggingContext, e.ProjectRootElementCache); 52Assert.True(taskRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(expectedRegisteredTask, null)), 58Assert.True(taskoverrideRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(expectedRegisteredTask, null)), 64Assert.False(taskRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(unexpectedRegisteredTask, null)), 70Assert.False(taskoverrideRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(unexpectedRegisteredTask, null)), 89TaskRegistry taskoverrideRegistry = (TaskRegistry)t.GetOverrideTaskRegistry(loggingContext, e.ProjectRootElementCache); 108TaskRegistry taskoverrideRegistry = (TaskRegistry)t.GetOverrideTaskRegistry(loggingContext, e.ProjectRootElementCache); 127TaskRegistry taskoverrideRegistry = (TaskRegistry)t.GetOverrideTaskRegistry(loggingContext, e.ProjectRootElementCache); 147TaskRegistry taskoverrideRegistry = (TaskRegistry)t.GetOverrideTaskRegistry(loggingContext, e.ProjectRootElementCache); 170TaskRegistry taskRegistry = (TaskRegistry)t.GetTaskRegistry(loggingContext, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache); 177Assert.True(taskRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(expectedRegisteredTask, null)), 182Assert.False(taskRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(unexpectedRegisteredTask, null)), 200TaskRegistry taskRegistry = (TaskRegistry)t.GetTaskRegistry(loggingContext, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache); 207Assert.False(taskRegistry.TaskRegistrations.ContainsKey(new TaskRegistry.RegisteredTaskIdentity(unexpectedRegisteredTask, null)), 223TaskRegistry taskRegistry = (TaskRegistry)t.GetTaskRegistry(loggingContext, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache); 938TaskRegistry taskRegistry = (TaskRegistry)t.GetTaskRegistry(loggingContext, ProjectCollection.GlobalProjectCollection.ProjectRootElementCache);
Instance\ProjectInstance_Internal_Tests.cs (4)
74project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t0", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af0")); 75project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t1", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyFile.ShouldBe(Path.Combine(Directory.GetCurrentDirectory(), "af1a")); 76project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t1", null)][1].TaskFactoryAssemblyLoadInfo.AssemblyName.ShouldBe("an1"); 77project.TaskRegistry.TaskRegistrations[new TaskRegistry.RegisteredTaskIdentity("t2", null)][0].TaskFactoryAssemblyLoadInfo.AssemblyName.ShouldBe("an2");
TestComparers\TaskRegistryComparers.cs (14)
18internal sealed class TaskRegistryComparer : IEqualityComparer<TaskRegistry> 20public bool Equals(TaskRegistry x, TaskRegistry y) 30Assert.Equal(xp.Key, yp.Key, TaskRegistry.RegisteredTaskIdentity.RegisteredTaskIdentityComparer.Exact); 37public int GetHashCode(TaskRegistry obj) 43internal sealed class RegisteredTaskRecordComparer : IEqualityComparer<TaskRegistry.RegisteredTaskRecord> 45public bool Equals(TaskRegistry.RegisteredTaskRecord x, TaskRegistry.RegisteredTaskRecord y) 47Assert.Equal(x.TaskIdentity, y.TaskIdentity, TaskRegistry.RegisteredTaskIdentity.RegisteredTaskIdentityComparer.Exact); 65public int GetHashCode(TaskRegistry.RegisteredTaskRecord obj) 71internal sealed class ParamterGroupAndTaskBodyComparer : IEqualityComparer<TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord> 74TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord x, 75TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord y) 92public int GetHashCode(TaskRegistry.RegisteredTaskRecord.ParameterGroupAndTaskElementRecord obj)