Esempio n. 1
0
        public static bool Execute(MiniLogger logger, String cmd, String args, string[] warningsToSuppress, string errorPrefix)
        {
            Process commandProcess = new Process();

            commandProcess.StartInfo.FileName  = cmd;
            commandProcess.StartInfo.Arguments = args;

            logger.CommandLine(cmd + " " + args);

            // Set UseShellExecute to false for redirection.
            commandProcess.StartInfo.UseShellExecute = false;

            // Redirect the standard output and error streams.
            // They are read asynchronously using an event handler.
            commandProcess.StartInfo.RedirectStandardOutput = true;
            commandProcess.StartInfo.RedirectStandardError  = true;

            LogFilter logFilter = new LogFilter(warningsToSuppress, errorPrefix, logger);

            commandProcess.OutputDataReceived += new DataReceivedEventHandler(logFilter.OutputFilter);
            commandProcess.ErrorDataReceived  += new DataReceivedEventHandler(logFilter.ErrorHandler);

            // Let's go do the real work
            commandProcess.Start();
            commandProcess.BeginOutputReadLine();
            commandProcess.BeginErrorReadLine();
            commandProcess.WaitForExit();

            // How'd it go?
            bool bOut = commandProcess.ExitCode == 0;

            commandProcess.Close();

            return(bOut);
        }
        public static bool Execute(MiniLogger logger, String cmd, String args, string[] warningsToSuppress, string errorPrefix)
        {
            Process commandProcess = new Process();

            commandProcess.StartInfo.FileName = cmd;
            commandProcess.StartInfo.Arguments = args;

            logger.CommandLine(cmd + " " + args);

            // Set UseShellExecute to false for redirection.
            commandProcess.StartInfo.UseShellExecute = false;

            // Redirect the standard output and error streams.
            // They are read asynchronously using an event handler.
            commandProcess.StartInfo.RedirectStandardOutput = true;
            commandProcess.StartInfo.RedirectStandardError = true;

            LogFilter logFilter = new LogFilter(warningsToSuppress, errorPrefix, logger);
            commandProcess.OutputDataReceived += new DataReceivedEventHandler(logFilter.OutputFilter);
            commandProcess.ErrorDataReceived += new DataReceivedEventHandler(logFilter.ErrorHandler);

            // Let's go do the real work
            commandProcess.Start();
            commandProcess.BeginOutputReadLine();
            commandProcess.BeginErrorReadLine();
            commandProcess.WaitForExit();

            // How'd it go?
            bool bOut = commandProcess.ExitCode == 0;

            commandProcess.Close();

            return bOut;
        }
Esempio n. 3
0
 public BBCover(MiniLogger ml)
 {
     _logger = ml;
 }
Esempio n. 4
0
 public BBCover()
 {
     _logger = new MsbuildDfltLogger(this);
 }
Esempio n. 5
0
 public BBCover(MiniLogger ml)
 {
     _logger = ml;
 }
Esempio n. 6
0
 public BBCover()
 {
     _logger = new MsbuildDfltLogger(this);
 }
Esempio n. 7
0
 public LogFilter(string[] warningsToSuppress, string prefix, MiniLogger logger)
 {
     _warningsToSuppress = warningsToSuppress;
     _errorPrefix        = prefix;
     _logger             = logger;
 }
 public LogFilter(string[] warningsToSuppress, string prefix, MiniLogger logger)
 {
     _warningsToSuppress = warningsToSuppress;
     _errorPrefix = prefix;
     _logger = logger;
 }