Esempio n. 1
0
        private LineOutColored?DotNetClean_OutputProcessor(EnumProcessOutputType type, string text)
        {
            if (text == null)
            {
                return(null);
            }
            EnumProcessOutputType processType = type;
            LineOutColored        lineOutColored;
            ReadOnlySpan <char>   textSpan = text;

            if (type == EnumProcessOutputType.ProcessErr)
            {
                return(LineOutColored.Error(text));
            }

            return(LineOutColored.Normal(text));
        }
Esempio n. 2
0
        /// <summary>
        /// Writes the given text as Errored output to both BuildStage output and to the console real time.
        /// </summary>
        /// <param name="text"></param>
        protected void AOT_Error(Exception exception)
        {
            string exceptionSeparator = "************************  [ Exception Encountered ] ************************";
            int    start = StageOutput.Count;

            StageOutput.Add(LineOutColored.Error(exceptionSeparator));
            StageOutput.Add(LineOutColored.Error(exception.Message));
            StageOutput.Add(LineOutColored.Error(exceptionSeparator));
            StageOutput.Add(LineOutColored.NewLine());
            StageOutput.Add(LineOutColored.Error(exception.ToString()));
            StageOutput.Add(LineOutColored.NewLine());


            if (ShouldLogToConsoleRealTime)
            {
                Print_StageOutput(start);
            }
        }
Esempio n. 3
0
        private LineOutColored?DotNetPack_OutputProcessor(EnumProcessOutputType type, string text)
        {
            if (text == null)
            {
                return(null);
            }
            EnumProcessOutputType processType = type;
            LineOutColored        lineOutColored;
            ReadOnlySpan <char>   textSpan = text;

            if (type == EnumProcessOutputType.ProcessErr)
            {
                return(LineOutColored.Error(text));
            }
            if (StringExtension.SpanSearcherContains(textSpan, "Successfully created package", 2, 32))
            {
                return(LineOutColored.Success(text));
            }
            return(LineOutColored.Normal(text));
        }
Esempio n. 4
0
        private LineOutColored?DotNetNugetPush_OutputProcessor(EnumProcessOutputType type, string text)
        {
            if (text == null)
            {
                return(null);
            }
            EnumProcessOutputType processType = type;
            LineOutColored        lineOutColored;
            ReadOnlySpan <char>   textSpan = text;

            if (type == EnumProcessOutputType.ProcessErr)
            {
                return(LineOutColored.Error(text));
            }

            if (StringExtension.SpanSearcherContains(textSpan, "warn :", 0, 7))
            {
                return(LineOutColored.Warning(text));
            }

            return(LineOutColored.Normal(text));
        }
Esempio n. 5
0
        private LineOutColored?DotNetRestore_OutputProcessor(EnumProcessOutputType type, string text)
        {
            if (text == null)
            {
                return(null);
            }
            EnumProcessOutputType processType = type;
            LineOutColored        lineOutColored;

            if (type == EnumProcessOutputType.ProcessErr)
            {
                return(LineOutColored.Error(text));
            }
            if (text.StartsWith("  Restored"))
            {
                return(LineOutColored.Success(text));
            }
            if (text.Contains("up-to-date:"))
            {
                return(LineOutColored.Success(text));
            }
            return(LineOutColored.Normal(text));
        }
Esempio n. 6
0
        private LineOutColored?DotNetBuild_OutputProcessor(EnumProcessOutputType type, string text)
        {
            if (text == null)
            {
                return(null);
            }
            EnumProcessOutputType processType = type;
            LineOutColored        lineOutColored;
            ReadOnlySpan <char>   textSpan = text;

            if (type == EnumProcessOutputType.ProcessErr)
            {
                return(LineOutColored.Error(text));
            }

            // Find index of the actual message part:
            // The plus 17 is arbitrary as the src path,. still has a project path and source filename as well as line and column number entries
            int compileMsgStart = CISession.SourceDirectory.Length + 17;

            if (text.Length > compileMsgStart)
            {
                int index = text.IndexOf(": ", compileMsgStart);
                if (index > 0)
                {
                    if (StringExtension.SpanSearcherContains(textSpan, "error", index + 2, index + 10))
                    {
                        return(LineOutColored.LogicError(text));
                    }
                    if (StringExtension.SpanSearcherContains(textSpan, "warning", index + 2, index + 10 + 50))
                    {
                        return(LineOutColored.Warning(text));
                    }
                }
            }
            return(LineOutColored.Normal(text));
        }