/// <summary> /// Constructor allows you to set the filname, toolsversion, targets to build, build properties and execution time. /// Following are the defaults: /// ToolsVersion = "ToolsVersion" /// GlobalProperties = new BuildPropertyGroup() /// ExecutionTime = 0; /// Targets to build = "target1" /// </summary> public RequestDefinition(string fileName, string toolsVersion, string[] targets, PropertyDictionary <ProjectPropertyInstance> properties, int executionTime, RequestDefinition[] childDefinitions, IBuildComponentHost host, bool noTargetsToBuild) { if (noTargetsToBuild || targets == null) { _targetsToBuild = new string[] { }; } else { _targetsToBuild = targets; } _globalProperties = ((properties == null) ? new PropertyDictionary <ProjectPropertyInstance>() : properties); _toolsVersion = ((toolsVersion == null) ? RequestDefinition.defaultToolsVersion : toolsVersion); _fileName = fileName; if (childDefinitions != null) { _childDefinitions = new List <RequestDefinition>(childDefinitions); foreach (RequestDefinition bd in childDefinitions) { _childDefinitions.Add(bd); } } else { _childDefinitions = new List <RequestDefinition>(); } _testProjectCompletedEvent = new AutoResetEvent(false); _executionTime = executionTime; _requestEngine = (IBuildRequestEngine)host.GetComponent(BuildComponentType.RequestEngine); _testDataProvider = (ITestDataProvider)host.GetComponent(BuildComponentType.TestDataProvider); _resultsCache = (IResultsCache)host.GetComponent(BuildComponentType.ResultsCache); _testDataProvider.AddDefinition(this); _projectDefinition = new ProjectDefinition(_fileName); _waitForCancel = false; }
/// <summary> /// Constructor allows you to set the filname, toolsversion, targets to build, build properties and execution time. /// Following are the defaults: /// ToolsVersion = "ToolsVersion" /// GlobalProperties = new BuildPropertyGroup() /// ExecutionTime = 0; /// Targets to build = "target1" /// </summary> public RequestDefinition(string fileName, string toolsVersion, string[] targets, PropertyDictionary<ProjectPropertyInstance> properties, int executionTime, RequestDefinition[] childDefinitions, IBuildComponentHost host, bool noTargetsToBuild) { if (noTargetsToBuild || targets == null) { _targetsToBuild = new string[] { }; } else { _targetsToBuild = targets; } _globalProperties = ((properties == null) ? new PropertyDictionary<ProjectPropertyInstance>() : properties); _toolsVersion = ((toolsVersion == null) ? RequestDefinition.defaultToolsVersion : toolsVersion); _fileName = fileName; if (childDefinitions != null) { _childDefinitions = new List<RequestDefinition>(childDefinitions); foreach (RequestDefinition bd in childDefinitions) { _childDefinitions.Add(bd); } } else { _childDefinitions = new List<RequestDefinition>(); } _testProjectCompletedEvent = new AutoResetEvent(false); _executionTime = executionTime; _requestEngine = (IBuildRequestEngine)host.GetComponent(BuildComponentType.RequestEngine); _testDataProvider = (ITestDataProvider)host.GetComponent(BuildComponentType.TestDataProvider); _resultsCache = (IResultsCache)host.GetComponent(BuildComponentType.ResultsCache); _testDataProvider.AddDefinition(this); _projectDefinition = new ProjectDefinition(_fileName); _waitForCancel = false; }