Add restore force option

This commit is contained in:
Nikolche Kolev 2017-06-02 17:04:57 -07:00
parent 87d754fc9e
commit 808ff7c6db
2 changed files with 13 additions and 0 deletions

View file

@ -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.";
}
}

View file

@ -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())
{