Ejemplo 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);
        }
Ejemplo n.º 2
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;
        }
Ejemplo n.º 3
0
 public BBCover(MiniLogger ml)
 {
     _logger = ml;
 }
Ejemplo n.º 4
0
 public BBCover()
 {
     _logger = new MsbuildDfltLogger(this);
 }
Ejemplo n.º 5
0
 public BBCover(MiniLogger ml)
 {
     _logger = ml;
 }
Ejemplo n.º 6
0
 public BBCover()
 {
     _logger = new MsbuildDfltLogger(this);
 }
Ejemplo n.º 7
0
 public LogFilter(string[] warningsToSuppress, string prefix, MiniLogger logger)
 {
     _warningsToSuppress = warningsToSuppress;
     _errorPrefix        = prefix;
     _logger             = logger;
 }
Ejemplo n.º 8
0
 public LogFilter(string[] warningsToSuppress, string prefix, MiniLogger logger)
 {
     _warningsToSuppress = warningsToSuppress;
     _errorPrefix = prefix;
     _logger = logger;
 }