本文整理汇总了C#中MonoDevelop.Projects.BuildResult类的典型用法代码示例。如果您正苦于以下问题:C# BuildResult类的具体用法?C# BuildResult怎么用?C# BuildResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuildResult类属于MonoDevelop.Projects命名空间,在下文中一共展示了BuildResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Build
public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null)
{
var res = new BuildResult { BuildCount = 0 };
foreach (var bt in Items.OfType<IBuildTarget> ())
res.Append (await bt.Build (monitor, configuration, operationContext:operationContext));
return res;
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:Workspace.cs
示例2: Build
/// <summary>
/// Builds the specified solution item.
/// </summary>
/// <param name = "monitor">The monitor.</param>
/// <param name = "item">The item.</param>
/// <param name = "configuration">The configuration.</param>
/// <returns>The build result.</returns>
protected override BuildResult Build(IProgressMonitor monitor, SolutionEntityItem item, ConfigurationSelector configuration)
{
BuildResult result = new BuildResult ();
// Pre-build
monitor.BeginTask (GettextCatalog.GetString ("Pre-Building..."), 1);
this.PreBuild (result, monitor, item, configuration);
monitor.EndTask();
if (result.ErrorCount > 0) {
return result;
}
// Build
monitor.BeginTask (GettextCatalog.GetString ("Building"), 1);
result.Append (base.Build (monitor, item, configuration));
monitor.EndTask();
if (result.ErrorCount > 0) {
return result;
}
// Post-build
monitor.BeginTask (GettextCatalog.GetString ("Post-Building..."), 1);
this.PostBuild (result, monitor, item, configuration);
monitor.EndTask();
return result;
}
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:34,代码来源:MonobjcBuildExtension.cs
示例3: CompileXibFiles
public static BuildResult CompileXibFiles (IProgressMonitor monitor, IEnumerable<ProjectFile> files,
FilePath outputRoot)
{
var result = new BuildResult ();
var ibfiles = GetIBFilePairs (files, outputRoot).Where (NeedsBuilding).ToList ();
if (ibfiles.Count > 0) {
monitor.BeginTask (GettextCatalog.GetString ("Compiling interface definitions"), 0);
foreach (var file in ibfiles) {
file.EnsureOutputDirectory ();
var args = new ProcessArgumentBuilder ();
args.AddQuoted (file.Input);
args.Add ("--compile");
args.AddQuoted (file.Output);
var psi = new ProcessStartInfo ("ibtool", args.ToString ());
monitor.Log.WriteLine (psi.FileName + " " + psi.Arguments);
psi.WorkingDirectory = outputRoot;
string errorOutput;
int code;
try {
code = ExecuteCommand (monitor, psi, out errorOutput);
} catch (System.ComponentModel.Win32Exception ex) {
LoggingService.LogError ("Error running ibtool", ex);
result.AddError (null, 0, 0, null, "ibtool not found. Please ensure the Apple SDK is installed.");
return result;
}
if (code != 0) {
//FIXME: parse the plist that ibtool returns
result.AddError (null, 0, 0, null, "ibtool returned error code " + code);
}
}
monitor.EndTask ();
}
return result;
}
开发者ID:nickname100,项目名称:monodevelop,代码行数:35,代码来源:MacBuildUtilities.cs
示例4: OnBuild
protected override BuildResult OnBuild (MonoDevelop.Core.IProgressMonitor monitor, ConfigurationSelector configuration)
{
var restResult = RestClient.CompileScripts ();
var result = new BuildResult ();
foreach (var message in restResult.Messages)
{
var file = BaseDirectory + "/" + message.File;
var msg = message.Message;
var errorNum = "";
var messageStrings = message.Message.Split(':');
if (messageStrings.Length == 3)
{
var errorNumStrings = messageStrings[1].Split(' ');
if (errorNumStrings.Length > 1)
errorNum = errorNumStrings[errorNumStrings.Length - 1];
msg = messageStrings[2];
}
if(message.Type == "warning")
result.AddWarning(file, message.Line, message.Column, errorNum, msg);
else
result.AddError(file, message.Line, message.Column, errorNum, msg);
}
return result;
}
开发者ID:0xb1dd1e,项目名称:MonoDevelop.UnityMode,代码行数:31,代码来源:UnitySolution.cs
示例5: UpdateDesignerFile
public static BuildResult UpdateDesignerFile (
CodeBehindWriter writer,
DotNetProject project,
ProjectFile file, ProjectFile designerFile
)
{
var result = new BuildResult ();
//parse the ASP.NET file
var parsedDocument = TypeSystemService.ParseFile (project, file.FilePath).Result as WebFormsParsedDocument;
if (parsedDocument == null) {
result.AddError (string.Format ("Failed to parse file '{0}'", file.Name));
return result;
}
//TODO: ensure type system is up to date
CodeCompileUnit ccu;
result.Append (GenerateCodeBehind (project, designerFile.FilePath, parsedDocument, out ccu));
if (ccu != null) {
writer.WriteFile (designerFile.FilePath, ccu);
}
return result;
}
开发者ID:polluks,项目名称:monodevelop,代码行数:25,代码来源:WebFormsCodeBehind.cs
示例6: HandleCompilerOutput
/// <summary>
/// Scans errorString line-wise for filename-line-message patterns (e.g. "myModule(1): Something's wrong here") and add these error locations to the CompilerResults cr.
/// </summary>
public static void HandleCompilerOutput(AbstractDProject Project, BuildResult br, string errorString)
{
var reader = new StringReader(errorString);
string next;
while ((next = reader.ReadLine()) != null)
{
var error = ErrorExtracting.FindError(next, reader);
if (error != null)
{
if (error.ErrorText != null && error.ErrorText.Length > MaxErrorMsgLength)
error.ErrorText = error.ErrorText.Substring (0, MaxErrorMsgLength) + "...";
// dmd's error filenames may contain mixin location info
var m = mixinInlineRegex.Match (error.FileName);
if (m.Success) {
error.FileName = error.FileName.Substring (0, m.Index);
int line;
int.TryParse (m.Groups ["line"].Value, out line);
error.Line = line;
}
if (!Path.IsPathRooted(error.FileName))
error.FileName = Project.GetAbsoluteChildPath(error.FileName);
br.Append(error);
}
}
reader.Close();
}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:33,代码来源:ErrorExtracting.cs
示例7: CompileXibs
public static void CompileXibs(IProgressMonitor monitor, BuildData buildData, BuildResult result)
{
var cfg = (MonobjcProjectConfiguration)buildData.Configuration;
string appDir = ((MonobjcProjectConfiguration)buildData.Configuration).ResourcesDirectory;
var ibfiles = GetIBFilePairs(buildData.Items.OfType<ProjectFile>(), appDir).Where(f => f.NeedsBuilding()).ToList();
if (ibfiles.Count > 0) {
monitor.BeginTask(GettextCatalog.GetString("Compiling interface definitions"), 0);
foreach (var file in ibfiles) {
file.EnsureOutputDirectory();
var psi = new ProcessStartInfo("ibtool", String.Format("\"{0}\" --compile \"{1}\"", file.Input, file.Output));
monitor.Log.WriteLine(psi.FileName + " " + psi.Arguments);
psi.WorkingDirectory = cfg.OutputDirectory;
string errorOutput;
int code = BuildUtils.ExecuteCommand(monitor, psi, out errorOutput);
if (code != 0) {
//FIXME: parse the plist that ibtool returns
result.AddError(null, 0, 0, null, "ibtool returned error code " + code);
}
}
monitor.EndTask();
}
}
开发者ID:JeanAzzopardi,项目名称:monodevelop-monobjc,代码行数:25,代码来源:BuildUtils.cs
示例8: ToBuildResult
public static BuildResult ToBuildResult(this DiagnosticsMessage message)
{
var result = new BuildResult ();
AddErrors (result.AddWarning, message.Warnings);
AddErrors (result.AddError, message.Errors);
return result;
}
开发者ID:twing207,项目名称:monodevelop-dnx-addin,代码行数:7,代码来源:DiagnosticsMessageExtensions.cs
示例9: BuildProject
public static BuildResult BuildProject(DubProject prj, IProgressMonitor mon, ConfigurationSelector sel)
{
var br = new BuildResult();
// Skip building sourceLibraries
string targetType = null;
var cfg = prj.GetConfiguration (sel) as DubProjectConfiguration;
if (cfg != null){
cfg.BuildSettings.TryGetTargetTypeProperty (prj, sel, ref targetType);
if(string.IsNullOrWhiteSpace(targetType))
prj.CommonBuildSettings.TryGetTargetTypeProperty (prj, sel, ref targetType);
if (targetType != null && targetType.ToLower ().Contains("sourcelibrary")) {
br.BuildCount = 1;
return br;
}
}
var args = new StringBuilder("build");
BuildCommonArgAppendix(args, prj, sel);
string output;
string errDump;
int status = ProjectBuilder.ExecuteCommand(DubSettings.Instance.DubCommand, args.ToString(), prj.BaseDirectory,
mon, out errDump, out output);
br.CompilerOutput = output;
ErrorExtracting.HandleReturnCode (mon, br, status);
ErrorExtracting.HandleCompilerOutput(prj, br, output);
ErrorExtracting.HandleCompilerOutput(prj, br, errDump);
return br;
}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:35,代码来源:DubBuilder.cs
示例10: WaitForRestoreThenBuild
async Task<BuildResult> WaitForRestoreThenBuild (Task restoreTask, ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext)
{
try {
await restoreTask;
} catch (Exception ex) {
var result = new BuildResult ();
result.AddError (GettextCatalog.GetString ("{0}. Please see the Package Console for more details.", ex.Message));
return result;
}
return await base.OnBuild (monitor, configuration, operationContext);
}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:11,代码来源:PackageManagementMSBuildExtension.cs
示例11: Compile
public void Compile (PythonProject project,
FilePath fileName,
PythonConfiguration config,
BuildResult result)
{
if (String.IsNullOrEmpty (fileName))
throw new ArgumentNullException ("fileName");
else if (config == null)
throw new ArgumentNullException ("config");
else if (result == null)
throw new ArgumentNullException ("result");
else if (Runtime == null)
throw new InvalidOperationException ("No supported runtime!");
// Get our relative path within the project
if (!fileName.IsChildPathOf (project.BaseDirectory)) {
Console.WriteLine ("File is not within our project!");
return;
}
FilePath relName = fileName.ToRelative (project.BaseDirectory);
string outFile = relName.ToAbsolute (config.OutputDirectory);
if (!outFile.EndsWith (".py"))
return;
// Create the destination directory
FileInfo fileInfo = new FileInfo (outFile);
if (!fileInfo.Directory.Exists)
fileInfo.Directory.Create ();
// Create and start our process to generate the byte code
Process process = BuildCompileProcess (fileName, outFile, config.Optimize);
process.Start ();
process.WaitForExit ();
// Parse errors and warnings
string output = process.StandardError.ReadToEnd ();
// Extract potential Warnings
foreach (Match m in m_WarningRegex.Matches (output)) {
string lineNum = m.Groups[m_WarningRegex.GroupNumberFromName ("line")].Value;
string message = m.Groups[m_WarningRegex.GroupNumberFromName ("message")].Value;
result.AddWarning (fileName, Int32.Parse (lineNum), 0, String.Empty, message);
}
// Extract potential SyntaxError
foreach (Match m in m_ErrorRegex.Matches (output)) {
string lineNum = m.Groups[m_ErrorRegex.GroupNumberFromName ("line")].Value;
result.AddError (fileName, Int32.Parse (lineNum), 0, String.Empty, "SyntaxError");
}
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:53,代码来源:Python25Compiler.cs
示例12: Generate
public static void Generate(IProgressMonitor monitor, BuildResult result, MonobjcProject project, ConfigurationSelector configuration, String outputDirectory, bool native)
{
// Infer application name from configuration
String applicationName = project.GetApplicationName(configuration);
LoggingService.LogInfo("Generate => applicationName='" + applicationName + "'");
LoggingService.LogInfo("Generate => outputDirectory='" + outputDirectory + "'");
// Create the bundle maker
BundleMaker maker = new BundleMaker(applicationName, outputDirectory);
// Compile the XIB files
BuildHelper.CompileXIBFiles(monitor, project, maker, result);
if (result.ErrorCount > 0)
{
monitor.ReportError(GettextCatalog.GetString("Failed to compile XIB files"), null);
return;
}
// Copy the output and dependencies
BuildHelper.CopyOutputFiles(monitor, project, configuration, maker);
// Copy the content files
BuildHelper.CopyContentFiles(monitor, project, configuration, maker);
// Create the Info.plist
BuildHelper.CreateInfoPList(monitor, project, configuration, maker);
if (native)
{
GenerateNative(monitor, result, project, configuration, maker);
}
else
{
// Copy the Monobjc assemblies
BuildHelper.CopyMonobjcAssemblies(monitor, project, configuration, maker);
// Write the native runtime
monitor.BeginTask(GettextCatalog.GetString("Copying native launcher..."), 0);
maker.WriteRuntime(project.TargetOSVersion);
monitor.EndTask();
}
BuildHelper.CombineArtwork(monitor, project, maker);
BuildHelper.EncryptContentFiles(monitor, project, configuration, maker);
// Perform the signing
BuildHelper.SignBundle(monitor, project, maker);
BuildHelper.SignNativeBinaries(monitor, project, maker);
}
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:50,代码来源:BundleGenerator.cs
示例13: Archive
public static void Archive(IProgressMonitor monitor, BuildResult result, MonobjcProject project, ConfigurationSelector configuration, String outputDirectory)
{
monitor.BeginTask(GettextCatalog.GetString("Archiving..."), 0);
// Infer application name from configuration
String applicationName = project.GetApplicationName(configuration);
// Create the bundle maker
BundleMaker maker = new BundleMaker(applicationName, outputDirectory);
// Archive the application
BuildHelper.ArchiveBundle(monitor, project, maker);
monitor.EndTask();
}
开发者ID:Monobjc,项目名称:monobjc-monodevelop,代码行数:15,代码来源:BundleGenerator.cs
示例14: Pack
async Task<BuildResult> Pack (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets, OperationContext operationContext)
{
var result = new BuildResult ();
// Build the project and any dependencies first.
if (buildReferencedTargets && project.GetReferencedItems (configuration).Any ()) {
result = await project.Build (monitor, configuration, buildReferencedTargets, operationContext);
if (result.Failed)
return result;
}
// Generate the NuGet package by calling the Pack target.
var packResult = (await project.RunTarget (monitor, "Pack", configuration, new TargetEvaluationContext (operationContext))).BuildResult;
return result.Append (packResult);
}
开发者ID:PlayScriptRedux,项目名称:monodevelop,代码行数:15,代码来源:CreateNuGetPackageBuildTarget.cs
示例15: HandleReturnCode
/// <summary>
/// Checks a compilation return code,
/// and adds an error result if the compiler results
/// show no errors.
/// </summary>
/// <param name="monitor"></param>
/// <param name="br"> A <see cref="BuildResult"/>: The return code from a build run.</param>
/// <param name="returnCode">A <see cref="System.Int32"/>: A process return code.</param>
public static bool HandleReturnCode(IProgressMonitor monitor, BuildResult br, int returnCode)
{
if (returnCode != 0)
{
if (monitor != null)
monitor.Log.WriteLine("Exit code " + returnCode.ToString());
if(br.ErrorCount == 0)
br.AddError(string.Empty, 0, 0, string.Empty,
GettextCatalog.GetString("Build failed - check build output for details"));
return false;
}
return true;
}
开发者ID:DinrusGroup,项目名称:Mono-D,代码行数:23,代码来源:ErrorExtracting.cs
示例16: Compile
public static BuildResult Compile( ProjectFile file, MonoDevelop.Core.IProgressMonitor monitor, BuildData buildData)
{
switch (file.BuildAction) {
case "MonoGameShader":
{
var results = new BuildResult ();
monitor.Log.WriteLine ("Compiling Shader");
monitor.Log.WriteLine ("Shader : " + buildData.Configuration.OutputDirectory);
monitor.Log.WriteLine ("Shader : " + file.FilePath);
monitor.Log.WriteLine ("Shader : " + file.ToString ());
return results;
}
default:
return new BuildResult ();
}
}
开发者ID:nanexcool,项目名称:Monogame_templates,代码行数:16,代码来源:MonoGameProject.cs
示例17: ParseOut
static BuildResult ParseOut (string stdout, string stderr)
{
BuildResult result = new BuildResult ();
StringBuilder compilerOutput = new StringBuilder ();
bool typeLoadException = false;
foreach (string s in new string[] { stdout, stderr }) {
StreamReader sr = File.OpenText (s);
while (true) {
if (typeLoadException) {
compilerOutput.Append (sr.ReadToEnd ());
break;
}
string curLine = sr.ReadLine();
compilerOutput.AppendLine (curLine);
if (curLine == null)
break;
curLine = curLine.Trim();
if (curLine.Length == 0)
continue;
if (curLine.StartsWith ("Unhandled Exception: System.TypeLoadException") ||
curLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException")) {
//result.ClearErrors (); - something apparently not supported by this version of MD
typeLoadException = true;
}
BuildError error = CreateErrorFromString (curLine);
if (error != null)
result.Append (error);
}
sr.Close();
}
if (typeLoadException) {
Regex reg = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
if (reg.Match (compilerOutput.ToString ()).Success)
result.AddError ("", 0, 0, "", "Error: A referenced assembly may be built with an incompatible CLR version. See the compilation output for more details.");
else
result.AddError ("", 0, 0, "", "Error: A dependency of a referenced assembly may be missing, or you may be referencing an assembly created with a newer CLR version. See the compilation output for more details.");
}
result.CompilerOutput = compilerOutput.ToString ();
return result;
}
开发者ID:pzurek,项目名称:FSharpBinding.borked,代码行数:46,代码来源:FSharpBindingCompilerManager.cs
示例18: Build
protected override BuildResult Build (IProgressMonitor monitor, SolutionEntityItem project, ConfigurationSelector configuration)
{
var aspProject = project as AspNetAppProject;
//get the config object and validate
AspNetAppProjectConfiguration config = (AspNetAppProjectConfiguration)aspProject.GetConfiguration (configuration);
if (config == null || config.DisableCodeBehindGeneration) {
return base.Build (monitor, project, configuration);
}
var writer = CodeBehindWriter.CreateForProject (monitor, aspProject);
if (!writer.SupportsPartialTypes) {
return base.Build (monitor, project, configuration);
}
var result = new BuildResult ();
monitor.BeginTask ("Updating CodeBehind designer files", 0);
foreach (var file in aspProject.Files) {
ProjectFile designerFile = CodeBehind.GetDesignerFile (file);
if (designerFile == null)
continue;
if (File.GetLastWriteTimeUtc (designerFile.FilePath) > File.GetLastWriteTimeUtc (file.FilePath))
continue;
monitor.Log.WriteLine ("Updating CodeBehind for file '{0}'", file);
result.Append (CodeBehind.UpdateDesignerFile (writer, aspProject, file, designerFile));
}
writer.WriteOpenFiles ();
monitor.EndTask ();
if (writer.WrittenCount > 0)
monitor.Log.WriteLine ("{0} CodeBehind designer classes updated.", writer.WrittenCount);
else
monitor.Log.WriteLine ("No changes made to CodeBehind classes.");
if (result.Failed)
return result;
return result.Append (base.Build (monitor, project, configuration));
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:45,代码来源:VerifyCodeBehindBuildStep.cs
示例19: BuildProject
public static BuildResult BuildProject(DubProject prj, IProgressMonitor mon, ConfigurationSelector sel)
{
var br = new BuildResult();
var args = new StringBuilder("build");
Instance.BuildCommonArgAppendix(args, prj, sel);
string output;
string errDump;
int status = ProjectBuilder.ExecuteCommand(Instance.DubExecutable, args.ToString(), prj.BaseDirectory,
mon, out errDump, out output);
br.CompilerOutput = output;
ErrorExtracting.HandleReturnCode(mon, br, status);
ErrorExtracting.HandleCompilerOutput(prj, br, output);
ErrorExtracting.HandleCompilerOutput(prj, br, errDump);
return br;
}
开发者ID:simendsjo,项目名称:Mono-D,代码行数:21,代码来源:DubBuilder.cs
示例20: DoNativeBuild
public bool DoNativeBuild (IProgressMonitor monitor,
BuildResult res)
{
var arch = EnsureMonoRuntime (monitor, res);
if (arch == null)
return false;
var unversionedSo = CreateUnversionedSo (monitor, res);
if (unversionedSo == null)
return false;
if (!DoNativeMake (monitor, res, arch))
return false;
File.Delete (unversionedSo);
if (!DoNativePackaging (monitor, res, arch))
return false;
return true;
}
开发者ID:kitsilanosoftware,项目名称:MonoDevelop.Tizen,代码行数:21,代码来源:TizenSdkBuild.cs
注:本文中的MonoDevelop.Projects.BuildResult类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论