提交 74febf15 编写于 作者: A Andrew Arnott

Produce argument array instead of large string

上级 b416bb6a
......@@ -73,10 +73,10 @@ public int CodePage
}
[Output]
public string CommandLineInvocation
public ITaskItem[] CommandLineArgs
{
set { _store[nameof(CommandLineInvocation)] = value; }
get { return _store.GetOrDefault(nameof(CommandLineInvocation), string.Empty); }
set { _store[nameof(CommandLineArgs)] = value; }
get { return (ITaskItem[])_store[nameof(CommandLineArgs)]; }
}
public string DebugType
......@@ -194,10 +194,10 @@ public bool Prefer32Bit
get { return _store.GetOrDefault(nameof(Prefer32Bit), false); }
}
public bool ProvideCommandLineInvocation
public bool ProvideCommandLineArgs
{
set { _store[nameof(ProvideCommandLineInvocation)] = value; }
get { return _store.GetOrDefault(nameof(ProvideCommandLineInvocation), false); }
set { _store[nameof(ProvideCommandLineArgs)] = value; }
get { return _store.GetOrDefault(nameof(ProvideCommandLineArgs), false); }
}
public ITaskItem[] References
......@@ -331,9 +331,10 @@ protected override Encoding StandardOutputEncoding
protected override int ExecuteTool(string pathToTool, string responseFileCommands, string commandLineCommands)
{
if (ProvideCommandLineInvocation)
if (ProvideCommandLineArgs)
{
CommandLineInvocation = GenerateResponseFileContents();
CommandLineArgs = GetArguments(commandLineCommands, responseFileCommands, false)
.Select(arg => new TaskItem(arg)).ToArray();
}
if (SkipCompilerExecution)
......@@ -354,7 +355,7 @@ protected override int ExecuteTool(string pathToTool, string responseFileCommand
Language,
TryGetClientDir() ?? Path.GetDirectoryName(pathToTool),
CurrentDirectoryToUse(),
GetArguments(commandLineCommands, responseFileCommands),
GetArguments(commandLineCommands, responseFileCommands, true),
_sharedCompileCts.Token,
libEnvVariable: LibDirectoryToUse());
......@@ -523,10 +524,13 @@ public string GenerateResponseFileContents()
/// <summary>
/// Get the command line arguments to pass to the compiler.
/// </summary>
private string[] GetArguments(string commandLineCommands, string responseFileCommands)
private string[] GetArguments(string commandLineCommands, string responseFileCommands, bool emitServerLog)
{
CompilerServerLogger.Log($"CommandLine = '{commandLineCommands}'");
CompilerServerLogger.Log($"BuildResponseFile = '{responseFileCommands}'");
if (emitServerLog)
{
CompilerServerLogger.Log($"CommandLine = '{commandLineCommands}'");
CompilerServerLogger.Log($"BuildResponseFile = '{responseFileCommands}'");
}
var commandLineArguments =
CommandLineParser.SplitCommandLineIntoArguments(commandLineCommands, removeHashComments: true);
......
......@@ -19,7 +19,7 @@
@(_DebugSymbolsIntermediatePath);
$(NonExistentFile);
@(CustomAdditionalCompileOutputs)"
Returns="$(CscCommandLineInvocation)"
Returns="@(CscCommandLineArgs)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<!-- These two compiler warnings are raised when a reference is bound to a different version
......@@ -105,7 +105,7 @@
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineInvocation="$(ProvideCommandLineInvocation)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
References="@(ReferencePath)"
ReportAnalyzer="$(ReportAnalyzer)"
Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
......@@ -128,7 +128,7 @@
Win32Manifest="$(Win32Manifest)"
Win32Resource="$(Win32Resource)"
>
<Output TaskParameter="CommandLineInvocation" PropertyName="CscCommandLineInvocation" />
<Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />
</Csc>
<ItemGroup>
......
......@@ -19,7 +19,7 @@
@(_DebugSymbolsIntermediatePath);
$(NonExistentFile);
@(CustomAdditionalCompileOutputs)"
Returns="$(VbcCommandLineInvocation)"
Returns="@(VbcCommandLineArgs)"
DependsOnTargets="$(CoreCompileDependsOn)"
>
<PropertyGroup>
......@@ -97,7 +97,7 @@
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineInvocation="$(ProvideCommandLineInvocation)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
References="@(ReferencePath)"
RemoveIntegerChecks="$(RemoveIntegerChecks)"
ReportAnalyzer="$(ReportAnalyzer)"
......@@ -126,7 +126,7 @@
Win32Resource="$(Win32Resource)"
VBRuntime="$(VBRuntime)"
>
<Output TaskParameter="CommandLineInvocation" PropertyName="CscCommandLineInvocation" />
<Output TaskParameter="CommandLineArgs" ItemName="VbcCommandLineArgs" />
</Vbc>
<ItemGroup>
<_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册