Skip to content

Commit

Permalink
Merge pull request #52 from kant2002/Issue-50
Browse files Browse the repository at this point in the history
Don't report output from NAsm as error in case of warnings
  • Loading branch information
mterwoord committed Jan 23, 2015
2 parents fcdda66 + 711826d commit 90169ed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
39 changes: 15 additions & 24 deletions source/Cosmos.Build.MSBuild/BaseToolTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ protected bool ExecuteTool(string workingDir, string filename, string arguments,
xProcessStartInfo.RedirectStandardError = true;
xProcessStartInfo.CreateNoWindow = true;

//Log.LogWarning("Running '{0}' with arguments: '{1}'", filename, arguments);
//Log.LogWarning("Working directory = '{0}'", workingDir);
Log.LogCommandLine(string.Format("Executing command line \"{0}\" {1}", filename, arguments));
Log.LogCommandLine(string.Format("Working directory = '{0}'", workingDir));

using (var xProcess = new Process())
{
Expand Down Expand Up @@ -130,32 +130,23 @@ protected bool ExecuteTool(string workingDir, string filename, string arguments,
Log.LogError("Error occurred while invoking {0}.", name);
}
}

LogInfo logContent;
foreach (var xError in mErrors)
{
Log.LogError(xError);
if (ExtendLineError(xProcess.ExitCode, xError, out logContent))
{
Logs(logContent);
}
}

foreach (var xOutput in mOutput)
{
Log.LogMessage(xOutput);
}

//while (!xProcess.StandardOutput.EndOfStream)
//{
// var xLine = xProcess.StandardOutput.ReadLine();
// if (xLine != null)
// {
// Log.LogMessage(xLine);
// }
//}

//while (!xProcess.StandardError.EndOfStream)
//{
// var xLine = xProcess.StandardError.ReadLine();
// if (xLine != null)
// {
// Log.LogError(xLine);
// }
//}
if (ExtendLineOutput(xProcess.ExitCode, xOutput, out logContent))
{
Logs(logContent);
}
}

return xProcess.ExitCode == 0;
}
Expand All @@ -174,7 +165,7 @@ public virtual bool ExtendLineError(int exitCode, string errorMessage, out LogIn
return true;
}

public virtual bool ExtendLineOutput(int exitCode, ref string errorMessage, out LogInfo log)
public virtual bool ExtendLineOutput(int exitCode, string errorMessage, out LogInfo log)
{
log = new LogInfo();
log.logType = WriteType.Info;
Expand Down
8 changes: 8 additions & 0 deletions source/Cosmos.Build.MSBuild/IL2CPU.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,13 @@ public bool StackCorruptionDetectionEnabled
Log.LogMessage(MessageImportance.High, "IL2CPU task took {0}", xSW.Elapsed);
}
}

public override bool ExtendLineError(int exitCode, string errorMessage, out LogInfo log)
{
log = new LogInfo();
log.logType = WriteType.Error;
log.message = errorMessage;
return true;
}
}
}

0 comments on commit 90169ed

Please sign in to comment.