public static Command Create( ICommandResolverPolicy commandResolverPolicy, string commandName, IEnumerable <string> args, NuGetFramework framework = null, string configuration = Constants.DefaultConfiguration, string outputPath = null, string applicationName = null) { var commandSpec = CommandResolver.TryResolveCommandSpec( commandResolverPolicy, commandName, args, framework, configuration: configuration, outputPath: outputPath, applicationName: applicationName); if (commandSpec == null) { throw new CommandUnknownException(commandName); } var command = new Command(commandSpec); return(command); }
public static Command Create( ICommandResolverPolicy commandResolverPolicy, string commandName, IEnumerable <string> args, NuGetFramework framework = null, string configuration = Constants.DefaultConfiguration, string outputPath = null, string applicationName = null) { var commandSpec = CommandResolver.TryResolveCommandSpec( commandResolverPolicy, commandName, args, framework, configuration: configuration, outputPath: outputPath, applicationName: applicationName); if (commandSpec == null) { if (_knownCommandsAvailableAsDotNetTool.Contains(commandName, StringComparer.OrdinalIgnoreCase)) { throw new CommandAvailableAsDotNetToolException(commandName); } else { throw new CommandUnknownException(commandName); } } var command = new Command(commandSpec); return(command); }
override protected Command CreateCommand(ICommandResolverPolicy resolverPolicy, List <string> commandArgs) { Command command = Command.Create(resolverPolicy, _executablePath, commandArgs); foreach (var envVar in _environmentVariables) { command.EnvironmentVariable(envVar.Key, envVar.Value); } return(command); }
override protected Command CreateCommand(ICommandResolverPolicy resolverPolicy, List <string> commandArgs) { foreach (var envVar in _environmentVariables) { commandArgs.Add("--codegenopt"); string complusPrefix = "COMPlus_"; commandArgs.Add(String.Format("{0}={1}", envVar.Key.Substring(complusPrefix.Length), envVar.Value)); } Command command = Command.Create(resolverPolicy, _executablePath, commandArgs); return(command); }
public static CommandSpec TryResolveCommandSpec( ICommandResolverPolicy commandResolverPolicy, string commandName, IEnumerable <string> args, NuGetFramework framework = null, string configuration = Constants.DefaultConfiguration, string outputPath = null, string applicationName = null) { var commandResolverArgs = new CommandResolverArguments { CommandName = commandName, CommandArguments = args, Framework = framework, ProjectDirectory = Directory.GetCurrentDirectory(), Configuration = configuration, OutputPath = outputPath, ApplicationName = applicationName }; var defaultCommandResolver = commandResolverPolicy.CreateCommandResolver(); return(defaultCommandResolver.Resolve(commandResolverArgs)); }
abstract protected Command CreateCommand(ICommandResolverPolicy resolverPolicy, List <string> commandArgs);