Merge pull request #6756 from nkolev92/rel/1.1.0

Add restore force option
This commit is contained in:
Livar 2017-06-07 08:35:44 -07:00 committed by GitHub
commit aee2b92cef
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())
{