本文整理汇总了C#中SolutionEntityItem.SetNeedsBuilding方法的典型用法代码示例。如果您正苦于以下问题:C# SolutionEntityItem.SetNeedsBuilding方法的具体用法?C# SolutionEntityItem.SetNeedsBuilding怎么用?C# SolutionEntityItem.SetNeedsBuilding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolutionEntityItem
的用法示例。
在下文中一共展示了SolutionEntityItem.SetNeedsBuilding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
//FIXME: Check whether autogen.sh is required or not
protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem entry, ConfigurationSelector configuration)
{
Project project = entry as Project;
if (project == null)
return base.Build (monitor, entry, configuration);
MakefileData data = project.ExtendedProperties ["MonoDevelop.Autotools.MakefileInfo"] as MakefileData;
if (data == null || !data.SupportsIntegration || String.IsNullOrEmpty (data.BuildTargetName))
return base.Build (monitor, entry, configuration);
//FIXME: Gen autofoo ? autoreconf?
string output = String.Empty;
int exitCode = 0;
monitor.BeginTask (GettextCatalog.GetString ("Building {0}", project.Name), 1);
try {
string baseDir = project.BaseDirectory;
StringBuilder args = new StringBuilder ();
if (data.RelativeMakeCommand.EndsWith ("make", StringComparison.OrdinalIgnoreCase))
args.AppendFormat (" -j {0}", data.ParallelProcesses, data.BuildTargetName);
args.AppendFormat (" {0}", data.BuildTargetName);
StringWriter swOutput = new StringWriter ();
LogTextWriter chainedOutput = new LogTextWriter ();
chainedOutput.ChainWriter (monitor.Log);
chainedOutput.ChainWriter (swOutput);
ProcessWrapper process = Runtime.ProcessService.StartProcess (data.AbsoluteMakeCommand,
args.ToString (),
baseDir,
chainedOutput,
chainedOutput,
null);
process.WaitForOutput ();
exitCode = process.ExitCode;
output = swOutput.ToString ();
chainedOutput.Close ();
swOutput.Close ();
monitor.Step (1);
} catch (Exception e) {
monitor.ReportError (GettextCatalog.GetString ("Project could not be built: "), e);
return null;
} finally {
monitor.EndTask ();
}
TempFileCollection tf = new TempFileCollection ();
Regex regexError = data.GetErrorRegex (false);
Regex regexWarning = data.GetWarningRegex (false);
BuildResult cr = ParseOutput (tf, output, project.BaseDirectory, regexError, regexWarning);
if (exitCode != 0 && cr.FailedBuildCount == 0)
cr.AddError (GettextCatalog.GetString ("Build failed. See Build Output panel."));
else
entry.SetNeedsBuilding (false, configuration);
return cr;
}