Beispiel #1
0
        private T ReceiveEvent <T>(string[] tokens)
            where T : BuildEventArgs
        {
            var args = BuildWatcher.ParseEventArgs <T>(tokens);

            this.LastMessageTime = args.Time;
            return(args);
        }
Beispiel #2
0
        private void ProcessLog(string message)
        {
            var tokens = BuildWatcher.Tokenize(message);

            if (tokens.Length < 2)
            {
                this.IgnoreLog(message);
                return;
            }

            try
            {
                switch (tokens[BuildEventArgs.EventTypeArgIndex])
                {
                case "START_BUILD":
                    this.SessionStarted?.Invoke(this, this.ReceiveEvent <StartBuildEventArgs>(tokens));
                    break;

                case "STOP_BUILD":
                    this.SessionStopped?.Invoke(this, this.ReceiveEvent <StopBuildEventArgs>(tokens));
                    break;

                case "START_JOB":
                    this.JobStarted?.Invoke(this, this.ReceiveEvent <StartJobEventArgs>(tokens));
                    break;

                case "FINISH_JOB":
                    this.JobFinished?.Invoke(this, this.ReceiveEvent <FinishJobEventArgs>(tokens));
                    break;

                case "PROGRESS_STATUS":
                    this.ReportProgress?.Invoke(this, this.ReceiveEvent <ReportProgressEventArgs>(tokens));
                    break;

                case "GRAPH":
                    this.ReportCounter?.Invoke(this, this.ReceiveEvent <ReportCounterEventArgs>(tokens));
                    break;

                default:
                    this.IgnoreLog(message);
                    break;
                }
            }
            catch (ParseException)
            {
                this.IgnoreLog(message);
            }
        }