Merge pull request #5079 from Thealexbarney/restore-rid
Add Runtime Identifier option to dotnet-restore
This commit is contained in:
commit
3a90af1546
2 changed files with 14 additions and 0 deletions
|
@ -14,6 +14,10 @@
|
|||
|
||||
public const string CmdSourceOptionDescription = "Specifies a NuGet package source to use during the restore.";
|
||||
|
||||
public const string CmdRuntimeOption = "RUNTIME_IDENTIFIER";
|
||||
|
||||
public const string CmdRuntimeOptionDescription = "Target runtime to restore packages for.";
|
||||
|
||||
public const string CmdPackagesOption = "PACKAGES_DIRECTORY";
|
||||
|
||||
public const string CmdPackagesOptionDescription = "Directory to install packages in.";
|
||||
|
|
|
@ -35,6 +35,11 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
LocalizableStrings.CmdSourceOptionDescription,
|
||||
CommandOptionType.MultipleValue);
|
||||
|
||||
var runtimeOption = cmd.Option(
|
||||
$"-r|--runtime <{LocalizableStrings.CmdRuntimeOption}>",
|
||||
LocalizableStrings.CmdRuntimeOptionDescription,
|
||||
CommandOptionType.MultipleValue);
|
||||
|
||||
var packagesOption = cmd.Option(
|
||||
$"--packages <{LocalizableStrings.CmdPackagesOption}>",
|
||||
LocalizableStrings.CmdPackagesOptionDescription,
|
||||
|
@ -81,6 +86,11 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
msbuildArgs.Add($"/p:RestoreSources={string.Join("%3B", sourceOption.Values)}");
|
||||
}
|
||||
|
||||
if (runtimeOption.HasValue())
|
||||
{
|
||||
msbuildArgs.Add($"/p:RuntimeIdentifiers={string.Join("%3B", runtimeOption.Values)}");
|
||||
}
|
||||
|
||||
if (packagesOption.HasValue())
|
||||
{
|
||||
msbuildArgs.Add($"/p:RestorePackagesPath={packagesOption.Value()}");
|
||||
|
|
Loading…
Add table
Reference in a new issue