/// <summary> /// Copy constructor /// </summary> private BuildParameters(BuildParameters other) { ErrorUtilities.VerifyThrowInternalNull(other, "other"); _buildId = other._buildId; _culture = other._culture; _defaultToolsVersion = other._defaultToolsVersion; _enableNodeReuse = other._enableNodeReuse; _buildProcessEnvironment = other._buildProcessEnvironment != null ? new Dictionary <string, string>(other._buildProcessEnvironment) : null; _environmentProperties = other._environmentProperties != null ? new PropertyDictionary <ProjectPropertyInstance>(other._environmentProperties) : null; _forwardingLoggers = other._forwardingLoggers != null ? new List <ForwardingLoggerRecord>(other._forwardingLoggers) : null; _globalProperties = other._globalProperties != null ? new PropertyDictionary <ProjectPropertyInstance>(other._globalProperties) : null; _hostServices = other._hostServices; _loggers = other._loggers != null ? new List <ILogger>(other._loggers) : null; _maxNodeCount = other._maxNodeCount; _memoryUseLimit = other._memoryUseLimit; _nodeExeLocation = other._nodeExeLocation; _nodeId = other._nodeId; _onlyLogCriticalEvents = other._onlyLogCriticalEvents; _buildThreadPriority = other._buildThreadPriority; _toolsetProvider = other._toolsetProvider; _toolsetDefinitionLocations = other._toolsetDefinitionLocations; _toolsetProvider = other._toolsetProvider; _uiCulture = other._uiCulture; _detailedSummary = other._detailedSummary; _shutdownInProcNodeOnBuildFinish = other._shutdownInProcNodeOnBuildFinish; this.ProjectRootElementCache = other.ProjectRootElementCache; this.ResetCaches = other.ResetCaches; this.LegacyThreadingSemantics = other.LegacyThreadingSemantics; _saveOperatingEnvironment = other._saveOperatingEnvironment; _useSynchronousLogging = other._useSynchronousLogging; _disableInProcNode = other._disableInProcNode; _logTaskInputs = other._logTaskInputs; _logInitialPropertiesAndItems = other._logInitialPropertiesAndItems; }
/// <summary> /// Loads the toolsets if we don't have them already. /// </summary> private void EnsureToolsets() { if (_toolsetProvider != null) { return; } _toolsetProvider = new ToolsetProvider(DefaultToolsVersion, _environmentProperties, _globalProperties, ToolsetDefinitionLocations); }
/// <summary> /// Copy constructor /// </summary> internal BuildParameters(BuildParameters other, bool resetEnvironment = false) { ErrorUtilities.VerifyThrowInternalNull(other, nameof(other)); _buildId = other._buildId; _culture = other._culture; _defaultToolsVersion = other._defaultToolsVersion; _enableNodeReuse = other._enableNodeReuse; _buildProcessEnvironment = resetEnvironment ? CommunicationsUtilities.GetEnvironmentVariables() : other._buildProcessEnvironment != null ? new Dictionary <string, string>(other._buildProcessEnvironment) : null; _environmentProperties = other._environmentProperties != null ? new PropertyDictionary <ProjectPropertyInstance>(other._environmentProperties) : null; _forwardingLoggers = other._forwardingLoggers != null ? new List <ForwardingLoggerRecord>(other._forwardingLoggers) : null; _globalProperties = other._globalProperties != null ? new PropertyDictionary <ProjectPropertyInstance>(other._globalProperties) : null; HostServices = other.HostServices; _loggers = other._loggers != null ? new List <ILogger>(other._loggers) : null; _maxNodeCount = other._maxNodeCount; _memoryUseLimit = other._memoryUseLimit; _nodeExeLocation = other._nodeExeLocation; NodeId = other.NodeId; _onlyLogCriticalEvents = other._onlyLogCriticalEvents; #if FEATURE_THREAD_PRIORITY BuildThreadPriority = other.BuildThreadPriority; #endif _toolsetProvider = other._toolsetProvider; ToolsetDefinitionLocations = other.ToolsetDefinitionLocations; _toolsetProvider = other._toolsetProvider; _uiCulture = other._uiCulture; DetailedSummary = other.DetailedSummary; _shutdownInProcNodeOnBuildFinish = other._shutdownInProcNodeOnBuildFinish; ProjectRootElementCache = other.ProjectRootElementCache; ResetCaches = other.ResetCaches; LegacyThreadingSemantics = other.LegacyThreadingSemantics; SaveOperatingEnvironment = other.SaveOperatingEnvironment; _useSynchronousLogging = other._useSynchronousLogging; _disableInProcNode = other._disableInProcNode; _logTaskInputs = other._logTaskInputs; _logInitialPropertiesAndItems = other._logInitialPropertiesAndItems; WarningsAsErrors = other.WarningsAsErrors == null ? null : new HashSet <string>(other.WarningsAsErrors, StringComparer.OrdinalIgnoreCase); WarningsAsMessages = other.WarningsAsMessages == null ? null : new HashSet <string>(other.WarningsAsMessages, StringComparer.OrdinalIgnoreCase); _projectLoadSettings = other._projectLoadSettings; _interactive = other._interactive; _isolateProjects = other._isolateProjects; _inputResultsCacheFiles = other._inputResultsCacheFiles; _outputResultsCacheFile = other._outputResultsCacheFile; DiscardBuildResults = other.DiscardBuildResults; LowPriority = other.LowPriority; ProjectCacheDescriptor = other.ProjectCacheDescriptor; }
/// <summary> /// Centralization of the common parts of construction. /// </summary> private void Initialize(PropertyDictionary <ProjectPropertyInstance> environmentProperties, ProjectRootElementCache projectRootElementCache, ToolsetProvider toolsetProvider) { _buildProcessEnvironment = CommunicationsUtilities.GetEnvironmentVariables(); _environmentProperties = environmentProperties; this.ProjectRootElementCache = projectRootElementCache; this.ResetCaches = true; _toolsetProvider = toolsetProvider; if (Environment.GetEnvironmentVariable("MSBUILDDISABLENODEREUSE") == "1") // For example to disable node reuse within Visual Studio { _enableNodeReuse = false; } if (Environment.GetEnvironmentVariable("MSBUILDDETAILEDSUMMARY") == "1") // For example to get detailed summary within Visual Studio { _detailedSummary = true; } _nodeExeLocation = FindMSBuildExe(); }