/// <summary>
        /// Implementation of the serialization mechanism.
        /// </summary>
        void INodePacketTranslatable.Translate(INodePacketTranslator translator)
        {
            translator.Translate(ref _buildId);
            /* No build thread priority during translation.  We specifically use the default (which is ThreadPriority.Normal) */
            translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
            translator.TranslateCulture(ref _culture);
            translator.Translate(ref _defaultToolsVersion);
            translator.Translate(ref _disableInProcNode);
            translator.Translate(ref _enableNodeReuse);
            translator.TranslateProjectPropertyInstanceDictionary(ref _environmentProperties);
            /* No forwarding logger information sent here - that goes with the node configuration */
            translator.TranslateProjectPropertyInstanceDictionary(ref _globalProperties);
            /* No host services during translation */
            /* No loggers during translation */
            translator.Translate(ref _maxNodeCount);
            translator.Translate(ref _memoryUseLimit);
            translator.Translate(ref _nodeExeLocation);
            /* No node id during translation */
            translator.Translate(ref _onlyLogCriticalEvents);
            translator.Translate(ref s_startupDirectory);
            translator.TranslateCulture(ref _uiCulture);
            translator.Translate(ref _toolsetProvider, Microsoft.Build.Evaluation.ToolsetProvider.FactoryForDeserialization);
            translator.Translate(ref _useSynchronousLogging);
            translator.Translate(ref _shutdownInProcNodeOnBuildFinish);
            translator.Translate(ref _logTaskInputs);
            translator.Translate(ref _logInitialPropertiesAndItems);
            translator.TranslateEnum(ref _projectLoadSettings, (int)_projectLoadSettings);

            // ProjectRootElementCache is not transmitted.
            // ResetCaches is not transmitted.
            // LegacyThreadingSemantics is not transmitted.
        }
Example #2
0
 void INodePacketTranslatable.Translate(INodePacketTranslator translator)
 {
     translator.Translate(ref _loggerClassName);
     translator.Translate(ref _loggerSwitchParameters);
     translator.Translate(ref _loggerAssembly, AssemblyLoadInfo.FactoryForTranslation);
     translator.TranslateEnum(ref _verbosity, (int)_verbosity);
     translator.Translate(ref _loggerId);
 }
Example #3
0
 /// <summary>
 /// Translates the packet to/from binary form.
 /// </summary>
 /// <param name="translator">The translator to use.</param>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _taskResult, (int)_taskResult);
     translator.TranslateException(ref _taskException);
     translator.Translate(ref _taskExceptionMessage);
     translator.Translate(ref _taskExceptionMessageArgs);
     translator.TranslateDictionary(ref _taskOutputParameters, StringComparer.OrdinalIgnoreCase, TaskParameter.FactoryForDeserialization);
     translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
 }
Example #4
0
 /// <summary>
 /// Serialization method.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.Translate(ref _blockedGlobalRequestId);
     translator.Translate(ref _targetsInProgress);
     translator.Translate(ref _blockingGlobalRequestId);
     translator.Translate(ref _blockingTarget);
     translator.TranslateEnum(ref _yieldAction, (int)_yieldAction);
     translator.TranslateArray(ref _buildRequests);
 }
Example #5
0
        /// <summary>
        /// Read and reconstruct a BuildMessageEventArgs from the stream
        /// </summary>
        private BuildMessageEventArgs ReadBuildMessageEventFromStream(INodePacketTranslator translator, string message, string helpKeyword, string senderName)
        {
            MessageImportance importance = MessageImportance.Normal;

            translator.TranslateEnum(ref importance, (int)importance);

            BuildMessageEventArgs buildEvent = new BuildMessageEventArgs(message, helpKeyword, senderName, importance);

            return(buildEvent);
        }
 /// <summary>
 /// Serialization method.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.Translate(ref _blockedGlobalRequestId);
     translator.Translate(ref _targetsInProgress);
     translator.Translate(ref _blockingGlobalRequestId);
     translator.Translate(ref _blockingTarget);
     translator.TranslateEnum(ref _yieldAction, (int)_yieldAction);
     translator.TranslateArray(ref _buildRequests);
     translator.Translate(ref _partialBuildResult, packetTranslator => BuildResult.FactoryForDeserialization(packetTranslator));
 }
Example #7
0
 /// <summary>
 /// Reads/writes this packet
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _eventType, (int)_eventType);
     translator.Translate(ref _sinkId);
     if (translator.Mode == TranslationDirection.ReadFromStream)
     {
         ReadFromStream(translator);
     }
     else
     {
         WriteToStream(translator);
     }
 }
Example #8
0
        /// <summary>
        /// Reads/writes this packet
        /// </summary>
        public void Translate(INodePacketTranslator translator)
        {
            translator.Translate(ref _submissionId);
            translator.Translate(ref _configurationId);
            translator.Translate(ref _globalRequestId);
            translator.Translate(ref _parentGlobalRequestId);
            translator.Translate(ref _nodeRequestId);
            translator.Translate(ref _targets);
            translator.Translate(ref _parentBuildEventContext);
            translator.Translate(ref _buildEventContext);
            translator.TranslateEnum(ref _buildRequestDataFlags, (int)_buildRequestDataFlags);

            // UNDONE: (Compat) Serialize the host object.
        }
Example #9
0
        /// <summary>
        /// Write Task Command Line log message into the translator
        /// </summary>
        private void WriteTaskCommandLineEventToStream(TaskCommandLineEventArgs taskCommandLineEventArgs, INodePacketTranslator translator)
        {
            MessageImportance importance = taskCommandLineEventArgs.Importance;

            translator.TranslateEnum(ref importance, (int)importance);

            string commandLine = taskCommandLineEventArgs.CommandLine;

            translator.Translate(ref commandLine);

            string taskName = taskCommandLineEventArgs.TaskName;

            translator.Translate(ref taskName);
        }
Example #10
0
        /// <summary>
        /// Serialize / deserialize this item.
        /// </summary>
        public void Translate(INodePacketTranslator translator)
        {
            translator.TranslateEnum <TaskParameterType>(ref _parameterType, (int)_parameterType);

            switch (_parameterType)
            {
            case TaskParameterType.Null:
                _wrappedParameter = null;
                break;

            case TaskParameterType.String:
                string stringParam = (string)_wrappedParameter;
                translator.Translate(ref stringParam);
                _wrappedParameter = stringParam;
                break;

            case TaskParameterType.StringArray:
                string[] stringArrayParam = (string[])_wrappedParameter;
                translator.Translate(ref stringArrayParam);
                _wrappedParameter = stringArrayParam;
                break;

#if FEATURE_BINARY_SERIALIZATION
            case TaskParameterType.ValueType:
            case TaskParameterType.ValueTypeArray:
                translator.TranslateDotNet(ref _wrappedParameter);
                break;
#endif
            case TaskParameterType.ITaskItem:
                TranslateITaskItem(translator);
                break;

            case TaskParameterType.ITaskItemArray:
                TranslateITaskItemArray(translator);
                break;

            case TaskParameterType.Invalid:
                Exception exceptionParam = (Exception)_wrappedParameter;
                translator.TranslateException(ref exceptionParam);
                _wrappedParameter = exceptionParam;
                break;

            default:
                ErrorUtilities.ThrowInternalErrorUnreachable();
                break;
            }
        }
Example #11
0
        /// <summary>
        /// Read and reconstruct a TaskCommandLineEventArgs from the stream
        /// </summary>
        private TaskCommandLineEventArgs ReadTaskCommandLineEventFromStream(INodePacketTranslator translator, string message, string helpKeyword, string senderName)
        {
            MessageImportance importance = MessageImportance.Normal;

            translator.TranslateEnum(ref importance, (int)importance);

            string commandLine = null;

            translator.Translate(ref commandLine);

            string taskName = null;

            translator.Translate(ref taskName);

            TaskCommandLineEventArgs buildEvent = new TaskCommandLineEventArgs(commandLine, taskName, importance);

            return(buildEvent);
        }
Example #12
0
        /// <summary>
        /// Reads/writes this packet
        /// </summary>
        public void Translate(INodePacketTranslator translator)
        {
            translator.Translate(ref _submissionId);
            translator.Translate(ref _configurationId);
            translator.Translate(ref _globalRequestId);
            translator.Translate(ref _parentGlobalRequestId);
            translator.Translate(ref _nodeRequestId);
            translator.Translate(ref _targets);
            translator.Translate(ref _parentBuildEventContext);
            translator.Translate(ref _buildEventContext);
            translator.TranslateEnum(ref _buildRequestDataFlags, (int)_buildRequestDataFlags);

            // UNDONE: (Compat) Serialize the host object.
        }
Example #13
0
 /// <summary>
 /// Translator.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _resultCode, (int)_resultCode);
     translator.TranslateEnum(ref _actionCode, (int)_actionCode);
     translator.TranslateDotNet(ref _exception);
 }
        /// <summary>
        /// Read and reconstruct a BuildMessageEventArgs from the stream 
        /// </summary>
        private BuildMessageEventArgs ReadBuildMessageEventFromStream(INodePacketTranslator translator, string message, string helpKeyword, string senderName)
        {
            MessageImportance importance = MessageImportance.Normal;

            translator.TranslateEnum(ref importance, (int)importance);

            BuildMessageEventArgs buildEvent = new BuildMessageEventArgs(message, helpKeyword, senderName, importance);
            return buildEvent;
        }
        /// <summary>
        /// Read and reconstruct a TaskCommandLineEventArgs from the stream
        /// </summary>
        private TaskCommandLineEventArgs ReadTaskCommandLineEventFromStream(INodePacketTranslator translator, string message, string helpKeyword, string senderName)
        {
            MessageImportance importance = MessageImportance.Normal;
            translator.TranslateEnum(ref importance, (int)importance);

            string commandLine = null;
            translator.Translate(ref commandLine);

            string taskName = null;
            translator.Translate(ref taskName);

            TaskCommandLineEventArgs buildEvent = new TaskCommandLineEventArgs(commandLine, taskName, importance);
            return buildEvent;
        }
 /// <summary>
 /// Write a "standard" Message Log the translator 
 /// </summary>
 private void WriteBuildMessageEventToStream(BuildMessageEventArgs buildMessageEventArgs, INodePacketTranslator translator)
 {
     MessageImportance importance = buildMessageEventArgs.Importance;
     translator.TranslateEnum(ref importance, (int)importance);
 }
 /// <summary>
 /// Reads/writes this packet
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _eventType, (int)_eventType);
     translator.Translate(ref _sinkId);
     if (translator.Mode == TranslationDirection.ReadFromStream)
     {
         ReadFromStream(translator);
     }
     else
     {
         WriteToStream(translator);
     }
 }
Example #18
0
 void INodePacketTranslatable.Translate(INodePacketTranslator translator)
 {
     translator.Translate(ref _loggerClassName);
     translator.Translate(ref _loggerSwitchParameters);
     translator.Translate(ref _loggerAssembly, AssemblyLoadInfo.FactoryForTranslation);
     translator.TranslateEnum(ref _verbosity, (int)_verbosity);
     translator.Translate(ref _loggerId);
 }
Example #19
0
        /// <summary>
        /// Write a "standard" Message Log the translator
        /// </summary>
        private void WriteBuildMessageEventToStream(BuildMessageEventArgs buildMessageEventArgs, INodePacketTranslator translator)
        {
            MessageImportance importance = buildMessageEventArgs.Importance;

            translator.TranslateEnum(ref importance, (int)importance);
        }
Example #20
0
 /// <summary>
 /// Translator.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _resultCode, (int)_resultCode);
     translator.TranslateEnum(ref _actionCode, (int)_actionCode);
     translator.TranslateException(ref _exception);
 }
Example #21
0
 /// <summary>
 /// Serializes or deserializes a packet.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _reason, (int)_reason);
     translator.TranslateDotNet(ref _exception);
 }
        /// <summary>
        /// Write Task Command Line log message into the translator
        /// </summary>
        private void WriteTaskCommandLineEventToStream(TaskCommandLineEventArgs taskCommandLineEventArgs, INodePacketTranslator translator)
        {
            MessageImportance importance = taskCommandLineEventArgs.Importance;
            translator.TranslateEnum(ref importance, (int)importance);

            string commandLine = taskCommandLineEventArgs.CommandLine;
            translator.Translate(ref commandLine);

            string taskName = taskCommandLineEventArgs.TaskName;
            translator.Translate(ref taskName);
        }
Example #23
0
 /// <summary>
 /// Serialization method.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.Translate(ref _blockedGlobalRequestId);
     translator.Translate(ref _targetsInProgress);
     translator.Translate(ref _blockingGlobalRequestId);
     translator.Translate(ref _blockingTarget);
     translator.TranslateEnum(ref _yieldAction, (int)_yieldAction);
     translator.TranslateArray(ref _buildRequests);
 }
Example #24
0
 /// <summary>
 /// Serializes or deserializes a packet.
 /// </summary>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _reason, (int)_reason);
     translator.TranslateException(ref _exception);
 }
 /// <summary>
 /// Translates the packet to/from binary form.
 /// </summary>
 /// <param name="translator">The translator to use.</param>
 public void Translate(INodePacketTranslator translator)
 {
     translator.TranslateEnum(ref _taskResult, (int)_taskResult);
     translator.TranslateDotNet(ref _taskException);
     translator.Translate(ref _taskExceptionMessage);
     translator.Translate(ref _taskExceptionMessageArgs);
     translator.TranslateDictionary(ref _taskOutputParameters, StringComparer.OrdinalIgnoreCase, TaskParameter.FactoryForDeserialization);
     translator.TranslateDictionary(ref _buildProcessEnvironment, StringComparer.OrdinalIgnoreCase);
 }