提交 87834ac1 编写于 作者: A Ashley Hauck

Allow empty CscToolPath

上级 39633b33
......@@ -12,16 +12,23 @@ internal sealed class DotnetHost
public string CommandLineArgs { get; }
private DotnetHost(string toolNameOpt, string pathToToolOpt, string commandLineArgs)
/// <summary>
/// True if this tool is a managed executable, and will be invoked with `dotnet`.
/// False if this executable is being invoked directly.
/// </summary>
public bool IsManagedTool { get; }
private DotnetHost(string toolNameOpt, string pathToToolOpt, string commandLineArgs, bool isManagedTool)
{
ToolNameOpt = toolNameOpt;
PathToToolOpt = pathToToolOpt;
CommandLineArgs = commandLineArgs;
IsManagedTool = isManagedTool;
}
public static DotnetHost CreateUnmanagedToolInvocation(string pathToTool, string commandLineArgs)
{
return new DotnetHost(null, pathToTool, commandLineArgs);
return new DotnetHost(null, pathToTool, commandLineArgs, isManagedTool: false);
}
public static DotnetHost CreateManagedToolInvocation(string toolNameWithoutExtension, string commandLineArgs)
......@@ -45,7 +52,7 @@ public static DotnetHost CreateManagedToolInvocation(string toolNameWithoutExten
pathToToolOpt = Utilities.GenerateFullPathToTool(toolName);
}
return new DotnetHost(toolName, pathToToolOpt, commandLineArgs);
return new DotnetHost(toolName, pathToToolOpt, commandLineArgs, isManagedTool: true);
}
private static bool IsCliHost(out string pathToDotnet)
......
......@@ -440,13 +440,13 @@ private DotnetHost DotnetHostInfo
if (ToolExe != _dotnetHostInfo.ToolNameOpt)
{
_dotnetHostInfo = DotnetHost.CreateUnmanagedToolInvocation(ToolPath, commandLine);
_dotnetHostInfo = DotnetHost.CreateUnmanagedToolInvocation(ToolExe, commandLine);
}
}
else
{
// Explicitly provided ToolPath, don't try to figure anything out
_dotnetHostInfo = DotnetHost.CreateUnmanagedToolInvocation(ToolPath, commandLine);
_dotnetHostInfo = DotnetHost.CreateUnmanagedToolInvocation(Path.Combine(ToolPath, ToolExe), commandLine);
}
}
return _dotnetHostInfo;
......@@ -488,7 +488,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
try
{
if (!UseSharedCompilation ||
!string.IsNullOrEmpty(ToolPath) ||
!DotnetHostInfo.IsManagedTool ||
!BuildServerConnection.IsCompilerServerSupported)
{
return base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册