예제 #1
0
        public HashSet <string> GetNextCsFilesToUncommentErrorLog(int nextProjIdx)
        {
            var knownErrors = new HashSet <string>()
            {
                "error: C", "error: C"
            };
            var typesToUncomment = new HashSet <string>();
            var lines            = File.ReadAllLines(_outputfile);

            foreach (var line in lines)
            {
                if (knownErrors.Any(line.Contains))
                {
                    _consoleWriter.ConsoleWriteBackgroundColor($"known error: {line}", ConsoleColor.DarkGray);
                    var match = Regex.Match(line, @"error : (.+?)""(.+?)""").Groups[2].Value;
                    typesToUncomment.Add(match);
                    continue;
                }
                if (line.Contains("error: "))
                {
                    _consoleWriter.ConsoleWriteBackgroundColor($"Unknown error: {line}", ConsoleColor.DarkMagenta);
                }
            }
            return(typesToUncomment);
        }
예제 #2
0
        public void Main()
        {
            try
            {
                _consoleWriter.ConsoleWriteBackgroundColor("Initializing project graph", ConsoleColor.DarkYellow);

                var compileWorker    = _provider.GetService <CompileWorker>();
                var projectProcessor = _provider.GetService <ProjectProcessor>();

                while (_nextProjectId < projectProcessor.NumberOfProjectsToProcess)
                {
                    if (!_continueWithProjectProcessing)
                    {
                        if (!compileWorker.Compile())
                        {
                            break;
                        }
                        projectProcessor.PrepareNextProj(_nextProjectId);
                    }

                    while (!compileWorker.Compile())
                    {
                        projectProcessor.UncommentMoreProjectFiles(_nextProjectId);
                    }
                    _nextProjectId++;
                }
            }
            catch (Exception ex)
            {
                _consoleWriter.ConsolePauseAndFix($"Fail to proceed: {ex}", ConsoleColor.DarkRed);
                throw;
            }
            _consoleWriter.ConsolePauseAndFix("Success!", ConsoleColor.DarkGreen);
        }
예제 #3
0
        public void Main()
        {
            INextStep nxt = GetNextStep();

            while (!nxt.Completed())
            {
                _consoleWriter.ConsoleWriteBackgroundColor("in while loop", ConsoleColor.DarkYellow);
                try
                {
                    if (nxt.ExpectedComilationSucces() && !nxt.Compile())
                    {
                        _consoleWriter.ConsolePauseAndFix("Expected compilation success, but failed!", ConsoleColor.Red);
                    }
                    nxt = nxt.Uncomment();
                }
                catch (Exception exception)
                {
                    _consoleWriter.ConsolePauseAndFix("Do something about exception!", ConsoleColor.Red);
                    File.WriteAllText(_errorOut, $"{exception}");
                }
            }
        }