Exemplo n.º 1
0
        private BuildEventArgs ReadBuildWarningEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();

            ReadDiagnosticFields(fields);

            BuildWarningEventArgs e = new BuildWarningEventArgs(
                fields.Subcategory,
                fields.Code,
                fields.File,
                fields.LineNumber,
                fields.ColumnNumber,
                fields.EndLineNumber,
                fields.EndColumnNumber,
                fields.Message,
                fields.HelpKeyword,
                fields.SenderName,
                fields.Timestamp)
            {
                BuildEventContext = fields.BuildEventContext,
                ProjectFile       = fields.ProjectFile
            };

            return(e);
        }
Exemplo n.º 2
0
        private BuildEventArgs ReadCriticalBuildMessageEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();

            /*(MessageImportance)*/ ReadInt32();

            CriticalBuildMessageEventArgs e = new CriticalBuildMessageEventArgs(
                fields.Subcategory,
                fields.Code,
                fields.File,
                fields.LineNumber,
                fields.ColumnNumber,
                fields.EndLineNumber,
                fields.EndColumnNumber,
                fields.Message,
                fields.HelpKeyword,
                fields.SenderName,
                fields.Timestamp)
            {
                BuildEventContext = fields.BuildEventContext,
                ProjectFile       = fields.ProjectFile
            };

            return(e);
        }
Exemplo n.º 3
0
        private BuildEventArgs ReadProjectEvaluationFinishedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            string projectFile          = ReadString();

            ProjectEvaluationFinishedEventArgs e = new ProjectEvaluationFinishedEventArgs(fields.Message)
            {
                ProjectFile = projectFile
            };

            SetCommonFields(e, fields);

            // ProfilerResult was introduced in version 5
            if (fileFormatVersion > 4)
            {
                bool hasProfileData = ReadBoolean();
                if (hasProfileData)
                {
                    int count = ReadInt32();

                    Dictionary <EvaluationLocation, ProfiledLocation> d = new Dictionary <EvaluationLocation, ProfiledLocation>(count);
                    for (int i = 0; i < count; i++)
                    {
                        d.Add(ReadEvaluationLocation(), ReadProfiledLocation());
                    }
                    e.ProfilerResult = new ProfilerResult(d);
                }
            }

            return(e);
        }
Exemplo n.º 4
0
        private BuildEventArgs ReadProjectImportedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();

            // Read unused Importance, it defaults to Low
            ReadInt32();

            bool importIgnored = false;

            // the ImportIgnored field was introduced in file format version 3
            if (fileFormatVersion > 2)
            {
                importIgnored = ReadBoolean();
            }

            string importedProjectFile = ReadOptionalString();
            string unexpandedProject   = ReadOptionalString();

            ProjectImportedEventArgs e = new ProjectImportedEventArgs(
                fields.LineNumber,
                fields.ColumnNumber,
                fields.Message);

            SetCommonFields(e, fields);

            e.ProjectFile = fields.ProjectFile;

            e.ImportedProjectFile = importedProjectFile;
            e.UnexpandedProject   = unexpandedProject;
            e.ImportIgnored       = importIgnored;
            return(e);
        }
Exemplo n.º 5
0
 /// <summary>
 /// For errors and warnings these 8 fields are written out explicitly
 /// (their presence is not marked as a bit in the flags). So we have to
 /// read explicitly.
 /// </summary>
 /// <param name="fields"></param>
 private void ReadDiagnosticFields(BuildEventArgsFields fields)
 {
     fields.Subcategory     = ReadOptionalString();
     fields.Code            = ReadOptionalString();
     fields.File            = ReadOptionalString();
     fields.ProjectFile     = ReadOptionalString();
     fields.LineNumber      = ReadInt32();
     fields.ColumnNumber    = ReadInt32();
     fields.EndLineNumber   = ReadInt32();
     fields.EndColumnNumber = ReadInt32();
 }
Exemplo n.º 6
0
        private BuildEventArgs ReadProjectEvaluationStartedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            string projectFile          = ReadString();

            ProjectEvaluationStartedEventArgs e = new ProjectEvaluationStartedEventArgs(fields.Message)
            {
                ProjectFile = projectFile
            };

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 7
0
        private BuildEventArgs ReadBuildStartedEventArgs()
        {
            BuildEventArgsFields        fields      = ReadBuildEventArgsFields();
            Dictionary <string, string> environment = ReadStringDictionary();

            BuildStartedEventArgs e = new BuildStartedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                environment);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 8
0
        private BuildEventArgs ReadBuildFinishedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            bool succeeded = ReadBoolean();

            BuildFinishedEventArgs e = new BuildFinishedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                succeeded,
                fields.Timestamp);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 9
0
        private BuildEventArgs ReadProjectFinishedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            string projectFile          = ReadOptionalString();
            bool   succeeded            = ReadBoolean();

            ProjectFinishedEventArgs e = new ProjectFinishedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                projectFile,
                succeeded,
                fields.Timestamp);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 10
0
        private BuildEventArgs ReadTaskStartedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            string taskName             = ReadOptionalString();
            string projectFile          = ReadOptionalString();
            string taskFile             = ReadOptionalString();

            TaskStartedEventArgs e = new TaskStartedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                projectFile,
                taskFile,
                taskName,
                fields.Timestamp);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 11
0
        private BuildEventArgs ReadProjectStartedEventArgs()
        {
            BuildEventArgsFields fields        = ReadBuildEventArgsFields();
            BuildEventContext    parentContext = null;

            if (ReadBoolean())
            {
                parentContext = ReadBuildEventContext();
            }

            string projectFile  = ReadOptionalString();
            int    projectId    = ReadInt32();
            string targetNames  = ReadString();
            string toolsVersion = ReadOptionalString();

            Dictionary <string, string> globalProperties = null;

            if (fileFormatVersion > 6)
            {
                if (ReadBoolean())
                {
                    globalProperties = ReadStringDictionary();
                }
            }

            ArrayList   propertyList = ReadPropertyList();
            IEnumerable itemList     = ReadItems();

            ProjectStartedEventArgs e = new ProjectStartedEventArgs(
                projectId,
                fields.Message,
                fields.HelpKeyword,
                projectFile,
                targetNames,
                propertyList,
                itemList,
                parentContext,
                globalProperties,
                toolsVersion);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 12
0
        private BuildEventArgs ReadTaskCommandLineEventArgs()
        {
            BuildEventArgsFields fields     = ReadBuildEventArgsFields();
            MessageImportance    importance = (MessageImportance)ReadInt32();
            string commandLine = ReadOptionalString();
            string taskName    = ReadOptionalString();

            TaskCommandLineEventArgs e = new TaskCommandLineEventArgs(
                commandLine,
                taskName,
                importance,
                fields.Timestamp)
            {
                BuildEventContext = fields.BuildEventContext,
                ProjectFile       = fields.ProjectFile
            };

            return(e);
        }
Exemplo n.º 13
0
        private void SetCommonFields(BuildEventArgs buildEventArgs, BuildEventArgsFields fields)
        {
            buildEventArgs.BuildEventContext = fields.BuildEventContext;

            if ((fields.Flags & BuildEventArgsFieldFlags.ThreadId) != 0)
            {
                buildEventArgsFieldThreadId.SetValue(buildEventArgs, fields.ThreadId);
            }

            if ((fields.Flags & BuildEventArgsFieldFlags.SenderName) != 0)
            {
                buildEventArgsFieldSenderName.SetValue(buildEventArgs, fields.SenderName);
            }

            if ((fields.Flags & BuildEventArgsFieldFlags.Timestamp) != 0)
            {
                buildEventArgsFieldTimestamp.SetValue(buildEventArgs, fields.Timestamp);
            }
        }
Exemplo n.º 14
0
        private BuildEventArgs ReadTargetFinishedEventArgs()
        {
            BuildEventArgsFields fields      = ReadBuildEventArgsFields();
            bool        succeeded            = ReadBoolean();
            string      projectFile          = ReadOptionalString();
            string      targetFile           = ReadOptionalString();
            string      targetName           = ReadOptionalString();
            IEnumerable targetOutputItemList = ReadItemList();

            TargetFinishedEventArgs e = new TargetFinishedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                targetName,
                projectFile,
                targetFile,
                succeeded,
                fields.Timestamp,
                targetOutputItemList);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 15
0
        private BuildEventArgs ReadTargetStartedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();
            string targetName           = ReadOptionalString();
            string projectFile          = ReadOptionalString();
            string targetFile           = ReadOptionalString();
            string parentTarget         = ReadOptionalString();
            // BuildReason was introduced in version 4
            TargetBuiltReason buildReason = fileFormatVersion > 3 ? (TargetBuiltReason)ReadInt32() : TargetBuiltReason.None;

            TargetStartedEventArgs e = new TargetStartedEventArgs(
                fields.Message,
                fields.HelpKeyword,
                targetName,
                projectFile,
                targetFile,
                parentTarget,
                buildReason,
                fields.Timestamp);

            SetCommonFields(e, fields);
            return(e);
        }
Exemplo n.º 16
0
        private BuildEventArgs ReadTargetSkippedEventArgs()
        {
            BuildEventArgsFields fields = ReadBuildEventArgsFields();

            // Read unused Importance, it defaults to Low
            ReadInt32();
            string            targetFile   = ReadOptionalString();
            string            targetName   = ReadOptionalString();
            string            parentTarget = ReadOptionalString();
            TargetBuiltReason buildReason  = (TargetBuiltReason)ReadInt32();

            TargetSkippedEventArgs e = new TargetSkippedEventArgs(
                fields.Message);

            SetCommonFields(e, fields);

            e.ProjectFile  = fields.ProjectFile;
            e.TargetFile   = targetFile;
            e.TargetName   = targetName;
            e.ParentTarget = parentTarget;
            e.BuildReason  = buildReason;

            return(e);
        }
Exemplo n.º 17
0
        private BuildEventArgsFields ReadBuildEventArgsFields()
        {
            BuildEventArgsFieldFlags flags  = (BuildEventArgsFieldFlags)ReadInt32();
            BuildEventArgsFields     result = new BuildEventArgsFields
            {
                Flags = flags
            };

            if ((flags & BuildEventArgsFieldFlags.Message) != 0)
            {
                result.Message = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.BuildEventContext) != 0)
            {
                result.BuildEventContext = ReadBuildEventContext();
            }

            if ((flags & BuildEventArgsFieldFlags.ThreadId) != 0)
            {
                result.ThreadId = ReadInt32();
            }

            if ((flags & BuildEventArgsFieldFlags.HelpHeyword) != 0)
            {
                result.HelpKeyword = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.SenderName) != 0)
            {
                result.SenderName = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.Timestamp) != 0)
            {
                result.Timestamp = ReadDateTime();
            }

            if ((flags & BuildEventArgsFieldFlags.Subcategory) != 0)
            {
                result.Subcategory = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.Code) != 0)
            {
                result.Code = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.File) != 0)
            {
                result.File = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.ProjectFile) != 0)
            {
                result.ProjectFile = ReadString();
            }

            if ((flags & BuildEventArgsFieldFlags.LineNumber) != 0)
            {
                result.LineNumber = ReadInt32();
            }

            if ((flags & BuildEventArgsFieldFlags.ColumnNumber) != 0)
            {
                result.ColumnNumber = ReadInt32();
            }

            if ((flags & BuildEventArgsFieldFlags.EndLineNumber) != 0)
            {
                result.EndLineNumber = ReadInt32();
            }

            if ((flags & BuildEventArgsFieldFlags.EndColumnNumber) != 0)
            {
                result.EndColumnNumber = ReadInt32();
            }

            return(result);
        }