コード例 #1
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);
        }
コード例 #2
0
 public void EventArgsCtors()
 {
     ProjectFinishedEventArgs projectFinishedEvent = new ProjectFinishedEventArgs2();
     projectFinishedEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", true);
     projectFinishedEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", true, DateTime.Now);
     projectFinishedEvent = new ProjectFinishedEventArgs(null, null, null, true);
     projectFinishedEvent = new ProjectFinishedEventArgs(null, null, null, true, DateTime.Now);
 }
コード例 #3
0
 void eventSource_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     Stopwatch.Stop();
     WriteMessage(String.Format("\nBuild {0}.", (e.Succeeded ? "succeeded" : "FAILED")));
     WriteMessage(String.Format("Time Elapsed {0:00}:{1:00}:{2:00}.{3:00}",
         Stopwatch.Elapsed.Hours,
         Stopwatch.Elapsed.Minutes,
         Stopwatch.Elapsed.Seconds,
         Stopwatch.Elapsed.Milliseconds));
     Stopwatch = null;
 }
コード例 #4
0
		public void AssignmentTest ()
		{
			ProjectFinishedEventArgs pfea;
			string message = "message";
			string helpKeyword = "helpKeyword";
			string projectFile = "projectFile";
			bool succeeded = true;
			
			pfea = new ProjectFinishedEventArgs (message, helpKeyword, projectFile, succeeded);
			
			Assert.AreEqual (message, pfea.Message, "Message");
			Assert.AreEqual (helpKeyword, pfea.HelpKeyword, "HelpKeyword");
			Assert.AreEqual (projectFile, pfea.ProjectFile, "ProjectFile");
			Assert.AreEqual (succeeded, pfea.Succeeded, "Succeeded");
		}
コード例 #5
0
		/// <summary>
		/// This is the delegate for ProjectFinishedHandler events.
		/// </summary>
		private void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buildEvent)
		{
            try
            {
                if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low
                                                         : MessageImportance.High))
                {
                    LogEvent(sender, buildEvent);
                }
            }
            catch (Exception e)
            {
                Debug.Assert(false, "Problem logging projectfinished event: " + e.Message + " at " + e.TargetSite);
                // swallow the exception
            }
		}
コード例 #6
0
ファイル: idebuildlogger.cs プロジェクト: Jeremiahf/wix3
 /// <summary>
 /// This is the delegate for ProjectFinishedHandler events.
 /// </summary>
 private void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buildEvent)
 {
     if (LogAtImportance(buildEvent.Succeeded ? MessageImportance.Low
                                              : MessageImportance.High))
     {
         LogEvent(sender, buildEvent);
     }
 }
コード例 #7
0
        /// <summary>
        /// This is the delegate for ProjectFinishedHandler events.
        /// </summary>
        protected virtual void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buildEvent)
        {
            if (buildEvent == null)
                throw new ArgumentNullException("buildEvent");

            // NOTE: This may run on a background thread!
            QueueOutputEvent(buildEvent.Succeeded ? MessageImportance.Low : MessageImportance.High, buildEvent);
        }
コード例 #8
0
        /// <summary>
        /// Compare this build event context with another object to determine 
        /// equality. This means the values inside the object are identical.
        /// </summary>
        /// <param name="obj">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(ProjectFinishedEventArgs args, ProjectFinishedEventArgs other)
        {
            if (args.Succeeded != other.Succeeded)
            {
                return false;
            }

            if (!String.Equals(args.ProjectFile, other.ProjectFile, StringComparison.OrdinalIgnoreCase))
            {
                return false;
            }

            return ((BuildEventArgs)args).IsEquivalent(other);
        }
コード例 #9
0
ファイル: Logger.cs プロジェクト: perpetual-motion/clrplus
 public BuildMessage(ProjectFinishedEventArgs args)
 {
     EventType = args.GetType().Name.Replace("EventArgs", "");
     Message = args.Message;
     ProjectFile = args.ProjectFile;
     Succeeded = args.Succeeded;
     HelpKeyword = args.HelpKeyword;
     SenderName = args.SenderName;
     Timestamp = args.Timestamp;
     ThreadId = args.ThreadId;
 }
コード例 #10
0
ファイル: MSBuildLogger.cs プロジェクト: JSchofield/BuildTool
 void ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     Projects.Add(e);
 }
コード例 #11
0
ファイル: BuildHelper.cs プロジェクト: kamsar/Beaver
 void eventSource_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     WriteLine(String.Empty, e, MessageType.Info);
 }
コード例 #12
0
        /// <summary>
        /// Handler for project finished events
        /// </summary>
        /// <param name="sender">sender (should be null)</param>
        /// <param name="e">event arguments</param>
        public override void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e)
        {
            if (this.showPerfSummary)
            {
                PerformanceCounter counter = GetPerformanceCounter(e.ProjectFile, ref projectPerformanceCounters);

                // Place the counter "in scope" meaning the project is done executing right now.
                counter.InScope = false;
            }

            // if verbosity is detailed or diagnostic, 
            // or there was an error or warning
            if (contextStack.Peek().hasErrorsOrWarnings
                || (IsVerbosityAtLeast(LoggerVerbosity.Detailed)))
            {
                setColor(ConsoleColor.Cyan);

                if (IsVerbosityAtLeast(LoggerVerbosity.Normal))
                {
                    WriteNewLine();
                }

                WriteLinePretty(e.Message);

                resetColor();
            }

            Frame top = contextStack.Pop();

            this.VerifyStack(top.type == FrameType.Project, "Unexpected project frame {0}", top.ID);
            this.VerifyStack(top.ID == e.ProjectFile, "Project frame {0} expected, but was {1}.", e.ProjectFile, top.ID);
        }
コード例 #13
0
 private void ProjectFinished(object sender, Microsoft.Build.Framework.ProjectFinishedEventArgs e)
 {
     ChromeTracer.AddEndEvent(e.ThreadId, "Project:" + Path.GetFileName(e.ProjectFile), GetTimeStamp(e.Timestamp), string.Empty);
 }
コード例 #14
0
 private void eventSource_ProjectFinished(object sender, Microsoft.Build.Framework.ProjectFinishedEventArgs e)
 {
     textBox.Text += Environment.NewLine + e.Message;
 }
コード例 #15
0
ファイル: XmlLogger.cs プロジェクト: jlewin/Kobush.Build
		private void eventSource_ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e)
		{
			LogStageFinished(e.Succeeded, e.Timestamp);
		}
コード例 #16
0
 private void eventSource_ProjectFinished(object sender, Microsoft.Build.Framework.ProjectFinishedEventArgs e)
 {
     this.AddNode(e.Message);
 }
コード例 #17
0
        public void TestProjectFinishedEventArgs()
        {
            // Test with reasonable values
            ProjectFinishedEventArgs genericEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", true);
            genericEvent.BuildEventContext = new BuildEventContext(5, 4, 3, 2);

            // Serialize
            genericEvent.WriteToStream(_writer);
            long streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            ProjectFinishedEventArgs newGenericEvent = new ProjectFinishedEventArgs(null, null, null, false);
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            long streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            Assert.IsTrue(genericEvent.Succeeded == newGenericEvent.Succeeded, "Expected Succeeded to Match");
            Assert.IsTrue(string.Compare(genericEvent.ProjectFile, newGenericEvent.ProjectFile, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFile to Match");

            // Test with empty strings
            _stream.Position = 0;
            genericEvent = new ProjectFinishedEventArgs(string.Empty, string.Empty, string.Empty, true);
            genericEvent.BuildEventContext = new BuildEventContext(5, 4, 3, 2);

            // Serialize
            genericEvent.WriteToStream(_writer);
            streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            newGenericEvent = new ProjectFinishedEventArgs(null, null, null, false);
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            Assert.IsTrue(genericEvent.Succeeded == newGenericEvent.Succeeded, "Expected Succeeded to Match");
            Assert.IsTrue(string.Compare(genericEvent.ProjectFile, newGenericEvent.ProjectFile, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFile to Match");

            // Test with null strings
            _stream.Position = 0;
            // Make sure null string are passed correctly
            genericEvent = new ProjectFinishedEventArgs(null, null, null, true);
            genericEvent.BuildEventContext = null;

            // Serialize
            genericEvent.WriteToStream(_writer);
            streamWriteEndPosition = _stream.Position;

            // Deserialize and Verify
            _stream.Position = 0;
            newGenericEvent = new ProjectFinishedEventArgs("Something", "Something", "Something", false);
            newGenericEvent.CreateFromStream(_reader, _eventArgVersion);
            streamReadEndPosition = _stream.Position;
            Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match");
            VerifyGenericEventArg(genericEvent, newGenericEvent);
            Assert.IsTrue(genericEvent.Succeeded == newGenericEvent.Succeeded, "Expected Succeeded to Match");
            Assert.IsTrue(string.Compare(genericEvent.ProjectFile, newGenericEvent.ProjectFile, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFile to Match");
        }
コード例 #18
0
 private void OnProjectFinished(object sender, ProjectFinishedEventArgs eventArgs)
 {
     _indent--;
     WriteLine(String.Empty, eventArgs);
 }
コード例 #19
0
 private void OnProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     indent--;
     Messages.Add(Message.CreateInfo(GetLine("Finished {0}", e.ProjectFile)));
 }
コード例 #20
0
ファイル: Logger.cs プロジェクト: perpetual-motion/clrplus
 private void eventSource_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     if (stop) {
         return;
     }
     Execute(new BuildMessage(e));
     if (stop) {
         KillThyself();
     }
 }
コード例 #21
0
ファイル: ConsoleLogger.cs プロジェクト: nikson/msbuild
        /// <summary>
        /// Handler for project finished events
        /// </summary>
        /// <param name="sender">sender (should be null)</param>
        /// <param name="e">event arguments</param>
        public void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e)
        {
            InitializeBaseConsoleLogger(); // for compat: see DDB#136924

            _consoleLogger.ProjectFinishedHandler(sender, e);
        }
コード例 #22
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");
        }
コード例 #23
0
ファイル: EventSourceSink.cs プロジェクト: cameron314/msbuild
        /// <summary>
        /// Raises a "project build finished" event to all registered loggers.
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="buildEvent">ProjectFinishedEventArgs</param>
        /// <exception cref="LoggerException">When EventHandler raises an logger exception the LoggerException is rethrown</exception>
        /// <exception cref="InternalLoggerException">Any exceptions which are not LoggerExceptions are wrapped in an InternalLoggerException</exception>
        /// <exception cref="Exception">ExceptionHandling.IsCriticalException exceptions will not be wrapped</exception>
        private void RaiseProjectFinishedEvent(object sender, ProjectFinishedEventArgs buildEvent)
        {
            if (ProjectFinished != null)
            {
                try
                {
                    ProjectFinished(sender, buildEvent);
                }
                catch (LoggerException)
                {
                    // if a logger has failed politely, abort immediately
                    // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
                    // if a fellow logger is throwing in an event handler.
                    this.UnregisterAllEventHandlers();
                    throw;
                }
                catch (Exception exception)
                {
                    // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings
                    // if a fellow logger is throwing in an event handler.
                    this.UnregisterAllEventHandlers();

                    if (ExceptionHandling.IsCriticalException(exception))
                    {
                        throw;
                    }

                    InternalLoggerException.Throw(exception, buildEvent, "FatalErrorWhileLogging", false);
                }
            }

            RaiseStatusEvent(sender, buildEvent);
        }
コード例 #24
0
 private void ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     this.indent--;
     this.WriteLine(e.Message);
 }
コード例 #25
0
 private void ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     this.LogFinished();
 }
コード例 #26
0
 void OnProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     TraceSource.TraceInformation(e.Message);
 }
コード例 #27
0
 private void eventSource_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
 	Console.WriteLine("project finished: file=\"{0}\"", e.ProjectFile);
 }
コード例 #28
0
ファイル: BaseConsoleLogger.cs プロジェクト: nikson/msbuild
 public abstract void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e);
コード例 #29
0
			void onProjectFinished(object sender, ProjectFinishedEventArgs e)
			{
				_projectResults.Add(new BuildResult(e.BuildEventContext.ProjectInstanceId, e.ProjectFile, e.Succeeded));
			}
コード例 #30
0
ファイル: Engine.cs プロジェクト: Jedzia/BackBock
 void LogProjectFinished(Project project, bool succeeded)
 {
     ProjectFinishedEventArgs pfea;
     pfea = new ProjectFinishedEventArgs ("Project started.", null, project.FullFileName, succeeded);
     eventSource.FireProjectFinished (this, pfea);
 }
コード例 #31
0
ファイル: Logger.cs プロジェクト: RKishore222/TestProject
 void eventSource_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     // The regular message string is good enough here too.
     indent--;
     WriteLine(String.Empty, e);
 }
コード例 #32
0
 /// <summary>
 /// This is the delegate for ProjectFinishedHandler events.
 /// </summary>
 protected virtual void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs buildEvent)
 {
     // NOTE: This may run on a background thread!
     QueueOutputEvent(buildEvent.Succeeded ? MessageImportance.Low : MessageImportance.High, buildEvent);
 }
コード例 #33
0
 /// <summary>
 /// Handle a project finished event
 /// </summary>
 /// <param name="sender">Who sent the event</param>
 /// <param name="e">Event raised on the event source</param>
 private void Source_ProjectFinished(object sender, ProjectFinishedEventArgs e)
 {
     HandleEvent(e);
 }