コード例 #1
0
        void TaskFinished(object sender, TaskFinishedEventArgs e)
        {
            if (!e.Succeeded)
            {
                AppendLine(string.Format("<font color='red'>{0}</font> task failed.\r\n{1}", e.TaskName, e.Message).ToMarkdownRawMarkdown());
            }
            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            {
                AppendLine(string.Format("######Task Finished:{0}", e.Message.EscapeMarkdownCharacters()).ToMarkdownRawMarkdown());
                AppendLine(e.ToPropertyValues().ToMarkdownTable().ToMarkdown().ToMarkdownRawMarkdown());
            }
            var startInfo = _tasksStarted.Pop();
            var execInfo  = new ExecutionInfo(startInfo.TaskName, startInfo, e);

            ExecutionInfo previousExecInfo;

            this._taskExecuted.TryGetValue(e.TaskName, out previousExecInfo);

            if (previousExecInfo != null)
            {
                execInfo.TimeSpent = execInfo.TimeSpent.Add(previousExecInfo.TimeSpent);
            }

            this._taskExecuted[execInfo.Name] = execInfo;
        }
コード例 #2
0
        void ProjectFinished(object sender, ProjectFinishedEventArgs e)
        {
            AppendLine("#####Project Finished".ToMarkdownRawMarkdown());

            if (IsVerbosityAtLeast(LoggerVerbosity.Normal))
            {
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            {
                AppendLine(e.ToPropertyValues().ToMarkdownTable());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic))
            {
                //e.it
            }

            var           startInfo = _projectsStarted.Pop();
            var           execInfo  = new ExecutionInfo(e.ProjectFile, startInfo, e);
            ExecutionInfo prevExecInfo;

            this._projectsExecutedMap.TryGetValue(e.ProjectFile, out prevExecInfo);
            if (prevExecInfo != null)
            {
                // shouldn't be found for projects but we can handle in either case
                execInfo.TimeSpent = execInfo.TimeSpent.Add(prevExecInfo.TimeSpent);

                var projToRemove = (from p in _projectsExecuted
                                    where p.Name.Equals(execInfo.Name)
                                    select p).ToList();

                foreach (var p in projToRemove)
                {
                    _projectsExecuted.Remove(p);
                }
            }

            _projectsExecutedMap[execInfo.Name] = execInfo;
            _projectsExecuted.Add(execInfo);
        }
コード例 #3
0
        void TargetFinished(object sender, TargetFinishedEventArgs e)
        {
            var startInfo = _targetsStarted.Pop();

            var execInfo = new ExecutionInfo(startInfo.TargetName, startInfo, e);
            // see if the target is already in the executed list
            ExecutionInfo prevExecInfo;

            this._targetsExecuted.TryGetValue(e.TargetName, out prevExecInfo);

            if (prevExecInfo != null)
            {
                execInfo.TimeSpent = execInfo.TimeSpent.Add(prevExecInfo.TimeSpent);
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Normal))
            {
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (!e.Succeeded || IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            {
                this._targetsExecuted[execInfo.Name] = execInfo;
                string color = e.Succeeded ? "green" : "red";
                AppendLine(string.Format(
                               "######<font color='{0}'>{1}</font> target finished",
                               color,
                               e.TargetName).ToMarkdownRawMarkdown());
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed))
            {
                AppendLine(e.ToPropertyValues().ToMarkdownTable());
            }
        }
コード例 #4
0
ファイル: MarkdownLogger.cs プロジェクト: 40a/psbuild-1
        void TaskFinished(object sender, TaskFinishedEventArgs e)
        {
            if (!e.Succeeded) {
                AppendLine(string.Format("<font color='red'>{0}</font> task failed.\r\n{1}",e.TaskName, e.Message).ToMarkdownRawMarkdown());
            }
            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) {
                AppendLine(string.Format("######Task Finished:{0}", e.Message.EscapeMarkdownCharacters()).ToMarkdownRawMarkdown());
                AppendLine(e.ToPropertyValues().ToMarkdownTable().ToMarkdown().ToMarkdownRawMarkdown());
            }
            var startInfo = _tasksStarted.Pop();
            var execInfo = new ExecutionInfo(startInfo.TaskName,startInfo, e);

            ExecutionInfo previousExecInfo;
            this._taskExecuted.TryGetValue(e.TaskName, out previousExecInfo);

            if (previousExecInfo != null) {
                execInfo.TimeSpent = execInfo.TimeSpent.Add(previousExecInfo.TimeSpent);
            }

            this._taskExecuted[execInfo.Name] = execInfo;
        }
コード例 #5
0
ファイル: MarkdownLogger.cs プロジェクト: 40a/psbuild-1
        void TargetFinished(object sender, TargetFinishedEventArgs e)
        {
            var startInfo = _targetsStarted.Pop();

            var execInfo = new ExecutionInfo(startInfo.TargetName, startInfo, e);
            // see if the target is already in the executed list
            ExecutionInfo prevExecInfo;
            this._targetsExecuted.TryGetValue(e.TargetName, out prevExecInfo);

            if (prevExecInfo != null) {
                execInfo.TimeSpent = execInfo.TimeSpent.Add(prevExecInfo.TimeSpent);
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) {
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (!e.Succeeded || IsVerbosityAtLeast(LoggerVerbosity.Detailed)) {
                this._targetsExecuted[execInfo.Name] = execInfo;
                string color = e.Succeeded ? "green" : "red";
                AppendLine(string.Format(
                    "######<font color='{0}'>{1}</font> target finished",
                    color,
                    e.TargetName).ToMarkdownRawMarkdown());
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) {
                AppendLine(e.ToPropertyValues().ToMarkdownTable());
            }
        }
コード例 #6
0
ファイル: MarkdownLogger.cs プロジェクト: 40a/psbuild-1
        void ProjectFinished(object sender, ProjectFinishedEventArgs e)
        {
            AppendLine("#####Project Finished".ToMarkdownRawMarkdown());

            if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) {
                AppendLine(e.Message.ToMarkdownParagraph());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) {
                AppendLine(e.ToPropertyValues().ToMarkdownTable());
            }

            if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)) {
                //e.it
            }

            var startInfo = _projectsStarted.Pop();
            var execInfo = new ExecutionInfo(e.ProjectFile, startInfo, e);
            ExecutionInfo prevExecInfo;
            this._projectsExecutedMap.TryGetValue(e.ProjectFile, out prevExecInfo);
            if (prevExecInfo != null) {
                // shouldn't be found for projects but we can handle in either case
                execInfo.TimeSpent = execInfo.TimeSpent.Add(prevExecInfo.TimeSpent);

                var projToRemove = (from p in _projectsExecuted
                                    where p.Name.Equals(execInfo.Name)
                                    select p).ToList();

                foreach (var p in projToRemove) {
                    _projectsExecuted.Remove(p);
                }
            }

            _projectsExecutedMap[execInfo.Name] = execInfo;
            _projectsExecuted.Add(execInfo);
        }