Add restore force option
This commit is contained in:
parent
87d754fc9e
commit
808ff7c6db
2 changed files with 13 additions and 0 deletions
|
@ -33,5 +33,8 @@
|
|||
public const string CmdIgnoreFailedSourcesOptionDescription = "Treat package source failures as warnings.";
|
||||
|
||||
public const string CmdNoDependenciesOptionDescription = "Set this flag to ignore project to project references and only restore the root project";
|
||||
|
||||
public const string CmdForceRestoreOptionDescription = "Set this flag to force all dependencies to be resolved even if the last restore was successful. This is equivalent to deleting project.assets.json.";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,11 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
"--no-dependencies",
|
||||
LocalizableStrings.CmdNoDependenciesOptionDescription,
|
||||
CommandOptionType.NoValue);
|
||||
|
||||
var forceOption = cmd.Option(
|
||||
$"-f|--force",
|
||||
LocalizableStrings.CmdForceRestoreOptionDescription,
|
||||
CommandOptionType.NoValue);
|
||||
|
||||
CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);
|
||||
|
||||
|
@ -120,6 +125,11 @@ namespace Microsoft.DotNet.Tools.Restore
|
|||
{
|
||||
msbuildArgs.Add($"/p:RestoreRecursive=false");
|
||||
}
|
||||
|
||||
if(forceOption.HasValue())
|
||||
{
|
||||
msbuildArgs.Add($"/p:RestoreForce=true");
|
||||
}
|
||||
|
||||
if (verbosityOption.HasValue())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue