提交 e387225c 编写于 作者: A Andrew Arnott

Move logging to caller, and remove one return statement

上级 74febf15
......@@ -333,7 +333,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
{
if (ProvideCommandLineArgs)
{
CommandLineArgs = GetArguments(commandLineCommands, responseFileCommands, false)
CommandLineArgs = GetArguments(commandLineCommands, responseFileCommands)
.Select(arg => new TaskItem(arg)).ToArray();
}
......@@ -351,11 +351,14 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
{
try
{
CompilerServerLogger.Log($"CommandLine = '{commandLineCommands}'");
CompilerServerLogger.Log($"BuildResponseFile = '{responseFileCommands}'");
var responseTask = BuildClient.TryRunServerCompilation(
Language,
TryGetClientDir() ?? Path.GetDirectoryName(pathToTool),
CurrentDirectoryToUse(),
GetArguments(commandLineCommands, responseFileCommands, true),
GetArguments(commandLineCommands, responseFileCommands),
_sharedCompileCts.Token,
libEnvVariable: LibDirectoryToUse());
......@@ -524,14 +527,8 @@ public string GenerateResponseFileContents()
/// <summary>
/// Get the command line arguments to pass to the compiler.
/// </summary>
private string[] GetArguments(string commandLineCommands, string responseFileCommands, bool emitServerLog)
private string[] GetArguments(string commandLineCommands, string responseFileCommands)
{
if (emitServerLog)
{
CompilerServerLogger.Log($"CommandLine = '{commandLineCommands}'");
CompilerServerLogger.Log($"BuildResponseFile = '{responseFileCommands}'");
}
var commandLineArguments =
CommandLineParser.SplitCommandLineIntoArguments(commandLineCommands, removeHashComments: true);
var responseFileArguments =
......
......@@ -273,13 +273,11 @@ public override bool Execute()
return false;
}
if (SkipCompilerExecution)
if (!SkipCompilerExecution)
{
return !Log.HasLoggedErrors;
MovePdbFileIfNecessary(OutputAssembly.ItemSpec);
}
MovePdbFileIfNecessary(OutputAssembly.ItemSpec);
return !Log.HasLoggedErrors;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册