示例#1
0
        void BeginBuildOperation(IEngineLogWriter logWriter, string binLogFilePath, MSBuildVerbosity verbosity, ProjectConfigurationInfo [] configurations)
        {
            // Start a new MSBuild build session, sending log to the provided writter

            RunSTA(delegate {
                BuildOperationStarted = true;
                // This property specifies the mapping between the solution configuration
                // and the project configurations
                engine.SetGlobalProperty("CurrentSolutionConfigurationContents", ProjectBuilder.GenerateSolutionConfigurationContents(configurations));
                BuildParameters parameters = new BuildParameters(engine);
                sessionLogWriter           = logWriter;
                loggerAdapter = new MSBuildLoggerAdapter(logWriter, verbosity);

                if (!string.IsNullOrEmpty(binLogFilePath))
                {
                    var binaryLogger = new BinaryLogger {
                        Parameters = binLogFilePath,
                        Verbosity  = LoggerVerbosity.Diagnostic
                    };

                    var loggers = new List <ILogger> (loggerAdapter.Loggers);
                    loggers.Add(binaryLogger);
                    parameters.Loggers = loggers;
                }
                else
                {
                    parameters.Loggers = loggerAdapter.Loggers;
                }

                BuildManager.DefaultBuildManager.BeginBuild(parameters);
            });
        }
        void BeginBuildOperation(IEngineLogWriter logWriter, MSBuildVerbosity verbosity, ProjectConfigurationInfo [] configurations)
        {
            // Start a new MSBuild build session, sending log to the provided writter

            RunSTA(delegate {
                BuildOperationStarted = true;
                // This property specifies the mapping between the solution configuration
                // and the project configurations
                engine.SetGlobalProperty("CurrentSolutionConfigurationContents", ProjectBuilder.GenerateSolutionConfigurationContents(configurations));
                BuildParameters parameters = new BuildParameters(engine);
                sessionLogWriter           = logWriter;
                loggerAdapter      = new MSBuildLoggerAdapter(logWriter, verbosity);
                parameters.Loggers = loggerAdapter.Loggers;
                BuildManager.DefaultBuildManager.BeginBuild(parameters);
            });
        }