Ejemplo n.º 1
0
 void BuildFinishedHandler(object sender, BuildFinishedEventArgs e)
 {
     // Console.Write in the context of a unit test is very expensive.  A hundred
     // calls to Console.Write can easily take two seconds on a fast machine.  Therefore, only
     // do the Console.Write once at the end of the build.
     Console.Write(fullLog);
 }
Ejemplo n.º 2
0
 private void FileLoggerBuildFinished(object sender, BuildFinishedEventArgs e)
 {
     if (_fileWriter != null)
     {
         _fileWriter.Flush();
     }
 }
Ejemplo n.º 3
0
        public void VerifyEventType()
        {
            BuildFinishedEventArgs buildFinished = new BuildFinishedEventArgs("Message", "Keyword", true);
            BuildStartedEventArgs buildStarted = new BuildStartedEventArgs("Message", "Help");
            BuildMessageEventArgs lowMessage = new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low);
            TaskStartedEventArgs taskStarted = new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName");
            TaskFinishedEventArgs taskFinished = new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true);
            TaskCommandLineEventArgs commandLine = new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low);
            BuildWarningEventArgs warning = new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
            BuildErrorEventArgs error = new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender");
            TargetStartedEventArgs targetStarted = new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile");
            TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true);
            ProjectStartedEventArgs projectStarted = new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null);
            ProjectFinishedEventArgs projectFinished = new ProjectFinishedEventArgs("message", "help", "ProjectFile", true);
            ExternalProjectStartedEventArgs externalStartedEvent = new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames");

            VerifyLoggingPacket(buildFinished, LoggingEventType.BuildFinishedEvent);
            VerifyLoggingPacket(buildStarted, LoggingEventType.BuildStartedEvent);
            VerifyLoggingPacket(lowMessage, LoggingEventType.BuildMessageEvent);
            VerifyLoggingPacket(taskStarted, LoggingEventType.TaskStartedEvent);
            VerifyLoggingPacket(taskFinished, LoggingEventType.TaskFinishedEvent);
            VerifyLoggingPacket(commandLine, LoggingEventType.TaskCommandLineEvent);
            VerifyLoggingPacket(warning, LoggingEventType.BuildWarningEvent);
            VerifyLoggingPacket(error, LoggingEventType.BuildErrorEvent);
            VerifyLoggingPacket(targetStarted, LoggingEventType.TargetStartedEvent);
            VerifyLoggingPacket(targetFinished, LoggingEventType.TargetFinishedEvent);
            VerifyLoggingPacket(projectStarted, LoggingEventType.ProjectStartedEvent);
            VerifyLoggingPacket(projectFinished, LoggingEventType.ProjectFinishedEvent);
            VerifyLoggingPacket(externalStartedEvent, LoggingEventType.CustomEvent);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Handles the BuildFinished event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="BuildFinishedEventArgs" /> instance containing the event data.</param>
        private void BuildFinishedEventHandler(object sender, BuildFinishedEventArgs e)
        {
            Log("Warning", "Project", "File", "Line", "Column", "Message");

            foreach (var warning in _warnings.OrderBy(w => w.Code))
            {
                Log(warning.Code, warning.ProjectFile, warning.File, warning.LineNumber.ToString(), warning.ColumnNumber.ToString(), warning.Message);
            }
        }
        private void BuildFinished(object sender, BuildFinishedEventArgs e)
        {
            this.handler(this, this.errors == 0 ? new ValEventArgs(e.Message, this.indent, Helper.MessageType.Success) : new ValEventArgs(e.Message, this.indent, Helper.MessageType.Error));

            this.handler(this, new ValEventArgs(string.Format(CultureInfo.InvariantCulture, "{0} Warning(s) ", this.warnings), this.indent));
            this.handler(this, new ValEventArgs(string.Format(CultureInfo.InvariantCulture, "{0} Error(s) ", this.errors) + Environment.NewLine + Environment.NewLine, this.indent));

            TimeSpan s = DateTime.UtcNow - this.startTime;
            this.handler(this, new ValEventArgs(string.Format(CultureInfo.InvariantCulture, "Time Elapsed {0}", s), this.indent));
        }
 public void EventArgsCtors()
 {
     BuildFinishedEventArgs buildFinishedEvent = new BuildFinishedEventArgs2();
     buildFinishedEvent = new BuildFinishedEventArgs("Message", "HelpKeyword", true);
     buildFinishedEvent = new BuildFinishedEventArgs("Message", "HelpKeyword", true, new DateTime());
     buildFinishedEvent = new BuildFinishedEventArgs("{0}", "HelpKeyword", true, new DateTime(), "Message");
     buildFinishedEvent = new BuildFinishedEventArgs(null, null, true);
     buildFinishedEvent = new BuildFinishedEventArgs(null, null, true, new DateTime());
     buildFinishedEvent = new BuildFinishedEventArgs(null, null, true, new DateTime(), null);
 }
Ejemplo n.º 7
0
 private void HandleBuildFinished(object sender, BuildFinishedEventArgs e)
 {
     if (e.Succeeded)
     {
         Console.WriteLine("Build succeeded. Warnings:{0}", m_warningCount);
     }
     else
     {
         Console.WriteLine("Build failed. Errors:{0} Warnings:{1}", m_errorCount, m_warningCount);
     }
 }
Ejemplo n.º 8
0
		public void AssignmentTest ()
		{
			BuildFinishedEventArgs bfea;
			string message = "message";
			string helpKeyword = "helpKeyword";
			bool succeeded = true;
			
			bfea = new BuildFinishedEventArgs (message, helpKeyword, succeeded);
			
			Assert.AreEqual (message, bfea.Message, "Message");
			Assert.AreEqual (helpKeyword, bfea.HelpKeyword, "HelpKeyword");
			Assert.AreEqual (succeeded, bfea.Succeeded, "Succeeded");
		}
Ejemplo n.º 9
0
        /// <summary>
        /// Handles the BuildFinished event.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="BuildFinishedEventArgs"/> instance containing the event data.</param>
        private void BuildFinishedEventHandler(object sender, BuildFinishedEventArgs e)
        {
            foreach (var category in _categories)
            {
                foreach (var warning in category.Value.OrderBy(w => w.Code))
                {
                    Console.ForegroundColor = category.Key.Color;
                    Console.WriteLine("\n[{4}] {0} ({1},{2}): {3}", Path.Combine(Path.GetDirectoryName(warning.ProjectFile), warning.File ?? string.Empty), warning.LineNumber, warning.ColumnNumber, warning.Message, warning.Code);
                    Console.ResetColor();
                }
            }

            foreach (var warning in _warnings.OrderBy(w => w.Code))
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("\n[{4}] {0} ({1},{2}): {3}", Path.Combine(Path.GetDirectoryName(warning.ProjectFile), warning.File ?? string.Empty), warning.LineNumber, warning.ColumnNumber, warning.Message, warning.Code);
                Console.ResetColor();
            }

            foreach (var error in _errors)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("\n[{4}] {0} ({1},{2}): {3}", Path.Combine(Path.GetDirectoryName(error.ProjectFile), error.File ?? string.Empty), error.LineNumber, error.ColumnNumber, error.Message, error.Code);
                Console.ResetColor();
            }

            Console.WriteLine();

            if (_categories.Count > 0)
            {
                foreach (var category in _categories)
                {
                    Console.ForegroundColor = category.Key.Color;
                    Console.Write("   {0} categorized warnings", category.Value.Count);
                    Console.WriteLine(!string.IsNullOrWhiteSpace(category.Key.Description) ? string.Format(" ({0})", category.Key.Description) : string.Empty);
                    Console.ResetColor();
                }
            }

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("   {0} warnings", _warnings.Count);
            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("   {0} errors\n", _errors.Count);
            Console.ResetColor();

            var buildFinishedTimeStamp = DateTime.Now;
            var timeSpan = buildFinishedTimeStamp - _buildStartedTimeStamp;
            Console.WriteLine("   Build finished at {0} in {1}.", buildFinishedTimeStamp, string.Format("{0:m\\:ss} minutes", timeSpan));
        }
Ejemplo n.º 10
0
        /// <summary>
        /// This is the delegate for BuildFinishedHandler events.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="buildEvent"></param>
        protected override void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEvent)
        {
            base.BuildFinishedHandler(sender, buildEvent);

            var msg =
                (BuildTargetName ?? "Build") +
                (buildEvent.Succeeded ? " succeeded -- " : " failed -- ") +
                (!buildEvent.Succeeded ? TaskCount(TaskErrorCategory.Error) + " errors, " : "") +
                (TaskCount(TaskErrorCategory.Warning) + " warnings. ") +
                ("Build took: " + _timer.Elapsed + ".") +
                Environment.NewLine;

            QueueOutputEvent(MessageImportance.High, new BuildFinishedEventArgs(msg, string.Empty, buildEvent.Succeeded));
        }
Ejemplo n.º 11
0
 void BuildFinished(object sender, BuildFinishedEventArgs e)
 {
     Console.ForegroundColor = ConsoleColor.White;
     if (e.Succeeded)
     {
         Console.ForegroundColor = ConsoleColor.DarkGreen;
         Console.WriteLine("Compilation SUCCEEDED! Errors:{0} Warnings:{1}",ErrorCount,WarningCount);
     }
     else
     {
         Console.ForegroundColor = ConsoleColor.DarkRed;
         Console.WriteLine("Compilation FAILED! Errors:{0} Warnings:{1}",ErrorCount,WarningCount);
     }
     Console.BackgroundColor = ConsoleColor.Black;
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Completes the build and writes to the XML log file.
        /// </summary>
        /// <param name="buildFinishedEventArgs">The <see cref="BuildFinishedEventArgs"/> instance containing the event data.</param>
        /// <param name="logFile">The XML log file.</param>
        public void CompleteBuild(BuildFinishedEventArgs buildFinishedEventArgs, string logFile, int errorCount, int warningCount)
        {
            EndTime = buildFinishedEventArgs.Timestamp;
            var document = new XDocument();
            var root = new XElement("Build",
                new XAttribute("BuildSucceeded", buildFinishedEventArgs.Succeeded),
                new XAttribute("StartTime", StartTime),
                new XAttribute("EndTime", EndTime),
                new XAttribute("Errors", errorCount),
                new XAttribute("Warnings", warningCount));

            document.Add(root);
            SaveToElement(root);

            document.Save(logFile);
        }
Ejemplo n.º 13
0
 void BuildFinished(object sender, BuildFinishedEventArgs e)
 {
     _stopwatch.Stop();
     Console.WriteLine();
     Console.WriteLine();
     Console.WriteLine("Compilation done in {0}ms.", _stopwatch.ElapsedMilliseconds);
     Console.WriteLine();
     Console.ForegroundColor = ConsoleColor.White;
     if (e.Succeeded)
     {
         Console.BackgroundColor = ConsoleColor.DarkGreen;
         Console.WriteLine("Compilation SUCCEEDED.");
     }
     else
     {
         Console.BackgroundColor = ConsoleColor.DarkRed;
         Console.WriteLine("Compilation FAILED!.");
     }
     Console.BackgroundColor = ConsoleColor.Black;
 }
Ejemplo n.º 14
0
		void HandleBuildFinished (object sender, BuildFinishedEventArgs args)
		{
			base.WriteHandler = null;
			if (sw != null) {
				sw.Close ();
				sw = null;
			}
		}
Ejemplo n.º 15
0
 void OnBuildFinished(object sender, BuildFinishedEventArgs e)
 {
     TraceSource.TraceInformation(e.Message);
 }
Ejemplo n.º 16
0
 /// <summary>
 /// This is the delegate for BuildFinishedHandler events.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="buildEvent"></param>
 private void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEvent)
 {
     if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low :
                                                MessageImportance.High))
     {
         if (this.outputWindowPane != null)
             this.outputWindowPane.OutputStringThreadSafe(Environment.NewLine);
         LogEvent(sender, buildEvent);
     }
 }
        public void ForwardEvents()
        {
            BuildStartedEventArgs buildStarted = new BuildStartedEventArgs("Message", "Help");
            BuildFinishedEventArgs buildFinished = new BuildFinishedEventArgs("Message", "Keyword", true);
            BuildMessageEventArgs normalMessage = new BuildMessageEventArgs("Message2", "help", "sender", MessageImportance.Normal);

            EventSourceSink loggerSource = AttachForwardingLoggerAndRedirector(buildStarted);
            loggerSource.Consume(buildStarted);

            loggerSource = AttachForwardingLoggerAndRedirector(buildFinished);
            loggerSource.Consume(buildFinished);

            loggerSource = AttachForwardingLoggerAndRedirector(normalMessage);
            loggerSource.Consume(normalMessage);
        }
Ejemplo n.º 18
0
        public void TestLoggingEventCustomerSerialization()
        {
            Hashtable loggingTypeCacheWrites = new Hashtable();
            stream.Position = 0;
            BuildEventContext context = new BuildEventContext(1,3,5,7);
            GenericBuildEventArg genericBuildEvent = new GenericBuildEventArg("Message","Help","Sender");
            genericBuildEvent.BuildEventContext = context;
            NodeLoggingEvent genericBuildEventLoggingEvent = new NodeLoggingEvent(genericBuildEvent);
            genericBuildEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            GenericCustomBuildEventArg genericCustomEvent = new GenericCustomBuildEventArg("FooFighter");
            genericCustomEvent.BuildEventContext = context;
            NodeLoggingEvent genericCustomEventLoggingEvent = new NodeLoggingEvent(genericCustomEvent);
            genericCustomEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            BuildErrorEventArgs errorEvent = new BuildErrorEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName");
            errorEvent.BuildEventContext = context;
            NodeLoggingEvent errorEventLoggingEvent = new NodeLoggingEvent(errorEvent);
            errorEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            BuildMessageEventArgs messageEvent = new BuildMessageEventArgs("Message", "HelpKeyword", "SenderName",MessageImportance.High);
            messageEvent.BuildEventContext = context;
            NodeLoggingEvent messageEventLoggingEvent = new NodeLoggingEvent(messageEvent);
            messageEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            BuildWarningEventArgs warningEvent = new BuildWarningEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName");
            warningEvent.BuildEventContext = context;
            NodeLoggingEvent warningEventLoggingEvent = new NodeLoggingEvent(warningEvent);
            warningEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            ProjectStartedEventArgs projectStartedEvent = new ProjectStartedEventArgs( 8,"Message", "HelpKeyword", "ProjectFile", "TargetNames", null, null, new BuildEventContext(7,8,9,10));
            projectStartedEvent.BuildEventContext = context;
            NodeLoggingEvent projectStartedEventLoggingEvent = new NodeLoggingEvent(projectStartedEvent);
            projectStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            ProjectFinishedEventArgs projectFinishedEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword","ProjectFile",true);
            projectFinishedEvent.BuildEventContext = context;
            NodeLoggingEvent projectFinishedEventLoggingEvent = new NodeLoggingEvent(projectFinishedEvent);
            projectFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            TargetStartedEventArgs targetStartedEvent = new TargetStartedEventArgs("Message", "HelpKeyword", "TargetName", "ProjectFile", "TargetFile");
            targetStartedEvent.BuildEventContext = context;
            NodeLoggingEvent targetStartedEventLoggingEvent = new NodeLoggingEvent(targetStartedEvent);
            targetStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("Message", "HelpKeyword","TargetName", "ProjectFile", "TargetFile", true);
            targetFinished.BuildEventContext = context;
            NodeLoggingEvent targetFinishedEventLoggingEvent = new NodeLoggingEvent(targetFinished);
            targetFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            TaskStartedEventArgs taskStartedEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName");
            taskStartedEvent.BuildEventContext = context;
            NodeLoggingEvent taskStartedEventLoggingEvent = new NodeLoggingEvent(taskStartedEvent);
            taskStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            TaskFinishedEventArgs taskFinishedEvent = new TaskFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName", true);
            taskFinishedEvent.BuildEventContext = context;
            NodeLoggingEvent taskFinishedEventLoggingEvent = new NodeLoggingEvent(taskFinishedEvent);
            taskFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            BuildFinishedEventArgs buildFinishedEvent = new BuildFinishedEventArgs("Message","Help",true);
            buildFinishedEvent.BuildEventContext = context;
            NodeLoggingEvent buildFinishedEventEventLoggingEvent = new NodeLoggingEvent(buildFinishedEvent);
            buildFinishedEventEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            BuildStartedEventArgs buildStartedEvent = new BuildStartedEventArgs("Message","Help");
            buildStartedEvent.BuildEventContext = context;
            NodeLoggingEvent buildStartedEventLoggingEvent = new NodeLoggingEvent(buildStartedEvent);
            buildStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            TaskCommandLineEventArgs commandlineEventArg = new TaskCommandLineEventArgs("CommandLine","TaskName", MessageImportance.High);
            commandlineEventArg.BuildEventContext = context;
            NodeLoggingEvent commandlineEventArgLoggingEvent = new NodeLoggingEvent(commandlineEventArg);
            commandlineEventArgLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites);

            Hashtable loggingTypeCacheReads = new Hashtable();
            long streamWriteEndPosition = stream.Position;
            stream.Position = 0;

            NodeLoggingEvent nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericBuildEventArg));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericCustomBuildEventArg));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildErrorEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildMessageEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildWarningEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(ProjectStartedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(ProjectFinishedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TargetStartedEventArgs));


            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TargetFinishedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TaskStartedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TaskFinishedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildFinishedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildStartedEventArgs));

            nodeLoggingEvent = new NodeLoggingEvent(null);
            nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads);
            Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() ==typeof( TaskCommandLineEventArgs));
            
            long streamReadEndPosition = stream.Position;
            Assert.AreEqual(streamWriteEndPosition, streamReadEndPosition, "Expected Read and Write Positions to match");
        }
        private void BuildFinished(object sender, BuildFinishedEventArgs e)
        {
            this.WriteLine(e.Message);
            this.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} Warning(s) ", this.warnings));
            this.WriteLine(string.Format(CultureInfo.InvariantCulture, "{0} Error(s) ", this.errors) + Environment.NewLine + Environment.NewLine);

            TimeSpan s = DateTime.UtcNow - this.startTime;
            this.WriteLine(string.Format(CultureInfo.InvariantCulture, "Time Elapsed {0}", s));
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Extension method to help our tests without adding shipping code.
        /// Compare this build event context with another object to determine 
        /// equality. This means the values inside the object are identical.
        /// </summary>
        /// <param name="args">The 'this' object</param>
        /// <param name="other">Object to compare to this object</param>
        /// <returns>True if the object values are identical, false if they are not identical</returns>
        public static bool IsEquivalent(this BuildFinishedEventArgs args, BuildFinishedEventArgs other)
        {
            if (args.Succeeded != other.Succeeded)
            {
                return false;
            }

            return ((BuildEventArgs)args).IsEquivalent(other);
        }
Ejemplo n.º 21
0
 private void eventSource_BuildFinished(object sender, Microsoft.Build.Framework.BuildFinishedEventArgs e)
 {
     this.AddNode(e.Message);
     this.AddNode(String.Format("      {0} Error(s)", errorsCount.ToString()));
     this.AddNode(String.Format("      {0} Warning(s)", warningsCount.ToString()));
 }
Ejemplo n.º 22
0
 private void eventSource_BuildFinished(object sender, Microsoft.Build.Framework.BuildFinishedEventArgs e)
 {
     textBox.Text += Environment.NewLine + e.Message;
     textBox.Text += Environment.NewLine + errorsCount.ToString() + " errors, " + warningsCount.ToString() + " warnings.";
 }
Ejemplo n.º 23
0
		private void eventSource_BuildFinishedHandler(object sender, BuildFinishedEventArgs e)
		{
			LogStageFinished(e.Succeeded, e.Timestamp);
		}
Ejemplo n.º 24
0
		/// <summary>
		/// This is the delegate for BuildFinishedHandler events.
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="buildEvent"></param>
		private void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEvent)
		{
            try
            {
                if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low :
                                                           MessageImportance.High))
                {
                    if (this.outputWindowPane != null)
                        Output(Environment.NewLine);
                    LogEvent(sender, buildEvent);
                }
                // BRIANMCN:
                // There are two reasons to call UIThread.Run.  
                // The obvious one is when you have to call IVsBlahBlah that must be accessed on the UI thread.  
                // That’s not the case here, here it’s for the less obvious reason that, whereas all the events 
                // happening in this class (that happen on the MSBuild logger thread) have a chronological 
                // ordering, most of those events transfer to the UIThread via UIThread.Run, and so we need to 
                // preserve the ordering.
                UIThread.Run(delegate()
                    {
                        taskReporter.OutputTaskList();
                    });
            }
            catch (Exception e)
            {
                Debug.Assert(false, "Problem logging buildfinished event: " + e.Message + " at " + e.TargetSite);
                // swallow the exception
            }
		}
Ejemplo n.º 25
0
 public abstract void BuildFinishedHandler(object sender, BuildFinishedEventArgs e);
Ejemplo n.º 26
0
 void BuildFinished(object sender, BuildFinishedEventArgs e)
 {
 }
Ejemplo n.º 27
0
 void LogBuildFinished(bool succeeded)
 {
     BuildFinishedEventArgs bfea;
     bfea = new BuildFinishedEventArgs ("Build finished.", null, succeeded);
     eventSource.FireBuildFinished (this, bfea);
 }
Ejemplo n.º 28
0
 private void OnBuildFinished(object sender, BuildFinishedEventArgs eventArgs)
 {
     _outputService.WriteLine(string.Empty);
 }
Ejemplo n.º 29
0
        /// <summary>
        /// This is the delegate for BuildFinishedHandler events.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="buildEvent"></param>
        protected virtual void BuildFinishedHandler(object sender, BuildFinishedEventArgs buildEvent)
        {
            // NOTE: This may run on a background thread!
            MessageImportance importance = buildEvent.Succeeded ? MessageImportance.Low : MessageImportance.High;
            QueueOutputText(importance, Environment.NewLine);
            QueueOutputEvent(importance, buildEvent);

            // flush output and error queues
            ReportQueuedOutput();
            ReportQueuedTasks();
        }
Ejemplo n.º 30
0
 public BuildMessage(BuildFinishedEventArgs args)
 {
     EventType = args.GetType().Name.Replace("EventArgs", "");
     Message = args.Message;
     Succeeded = args.Succeeded;
     HelpKeyword = args.HelpKeyword;
     SenderName = args.SenderName;
     Timestamp = args.Timestamp;
     ThreadId = args.ThreadId;
 }
Ejemplo n.º 31
0
 internal override void OutputBuildFinished(object sender, BuildFinishedEventArgs e)
 {
     logStream.WriteLine(FormatBuildFinishedEvent(e));
 }
Ejemplo n.º 32
0
        private void eventSource_BuildFinished(object sender, BuildFinishedEventArgs e)
        {
            if (stop) {
                return;
            }

            Execute(new BuildMessage(e));

            while (_messages.Count > 0 && !stop) {
                Thread.Sleep(10);
            }
        }