/// <summary> /// Fills the provided CommandLineBuilderExtension with those switches and other information that can go into a response file. /// </summary> protected virtual void AddResponseFileCommands(CommandLineBuilderExtension commandLine) { commandLine.AppendSwitch("/i-"); ManagedCompiler.AddFeatures(commandLine, Features); if (ResponseFiles != null) { foreach (var response in ResponseFiles) { commandLine.AppendSwitchIfNotNull("@", response.ItemSpec); } } commandLine.AppendFileNameIfNotNull(Source); if (ScriptArguments != null) { foreach (var scriptArgument in ScriptArguments) { commandLine.AppendTextUnquoted(scriptArgument); } } if (ResponseFiles != null) { foreach (var scriptResponse in ScriptResponseFiles) { commandLine.AppendSwitchIfNotNull("@", scriptResponse.ItemSpec); } } }
private static string PrependFileToArgs(string pathToTool, string commandLineArgs) { var builder = new CommandLineBuilderExtension(); builder.AppendFileNameIfNotNull(pathToTool); builder.AppendTextUnquoted(commandLineArgs); return(builder.ToString()); }