本文整理汇总了C#中Microsoft.Build.BuildEngine.Engine.PostBuildRequest方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.PostBuildRequest方法的具体用法?C# Engine.PostBuildRequest怎么用?C# Engine.PostBuildRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Build.BuildEngine.Engine
的用法示例。
在下文中一共展示了Engine.PostBuildRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NodeLocalEngineLoop
private void NodeLocalEngineLoop()
{
buildInProgress = true;
// Create a logging service for this build request
localEngine =
new Engine(parentGlobalProperties, toolsetSearchLocations, 1 /* cpus */, true /* child node */, this.nodeId, parentStartupDirectory, null);
localEngine.Router.ChildMode = true;
localEngine.Router.ParentNode = this;
this.outProcLoggingService = new EngineLoggingServicesOutProc(this, localEngine.FlushRequestEvent);
if (nodeLoggers.Length != 0)
{
foreach (LoggerDescription loggerDescription in nodeLoggers)
{
IForwardingLogger newLogger = null;
bool exitedDueToError = true;
try
{
newLogger = loggerDescription.CreateForwardingLogger();
// Check if the class was not found in the assembly
if (newLogger == null)
{
InternalLoggerException.Throw(null, null, "FatalErrorWhileInitializingLogger", true, loggerDescription.Name);
}
newLogger.Verbosity = loggerDescription.Verbosity;
newLogger.Parameters = loggerDescription.LoggerSwitchParameters;
newLogger.NodeId = nodeId;
EventRedirector newRedirector = new EventRedirector(loggerDescription.LoggerId, outProcLoggingService);
newLogger.BuildEventRedirector = newRedirector;
exitedDueToError = false;
}
// Polite logger failure
catch (LoggerException e)
{
ReportUnhandledError(e);
}
// Logger class was not found
catch (InternalLoggerException e)
{
ReportUnhandledError(e);
}
catch (Exception e)
{
// Wrap the exception in a InternalLoggerException and send it to the parent node
string errorCode;
string helpKeyword;
string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "FatalErrorWhileInitializingLogger", loggerDescription.Name);
ReportUnhandledError(new InternalLoggerException(message, e, null, errorCode, helpKeyword, true));
}
// If there was a failure registering loggers, null out the engine pointer
if (exitedDueToError)
{
localEngine = null;
return;
}
localEngine.RegisterLogger(newLogger);
}
localEngine.ExternalLoggingServices = outProcLoggingService;
}
// Hook up logging service to forward all events to the central engine if necessary
if (centralizedLogging)
{
if (nodeLoggers.Length != 0)
{
localEngine.LoggingServices.ForwardingService = outProcLoggingService;
localEngine.ExternalLoggingServices = outProcLoggingService;
}
else
{
localEngine.LoggingServices = outProcLoggingService;
}
}
localEngine.LoggingServices.OnlyLogCriticalEvents = this.logOnlyCriticalEvents;
if (!useBreadthFirstTraversal)
{
localEngine.PostEngineCommand(new ChangeTraversalTypeCommand(useBreadthFirstTraversal, true));
}
// Post all the requests that passed in while the engine was being constructed
// into the engine queue
lock (buildRequests)
{
while (buildRequests.Count != 0)
{
BuildRequest buildRequest = buildRequests.Dequeue();
localEngine.PostBuildRequest(buildRequest);
}
}
try
{
// If there are forwarding loggers registered - generate a custom build started
//.........这里部分代码省略.........