Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Add Implicit restore to run/build/publish/pack/test #6762

Merged
merged 3 commits into from
Jun 8, 2017

Conversation

livarcocc
Copy link

The missing piece here is adding restore options to the commands that support implicit restore, so that you can do things like dotnet build --configfile <path_to_config_file> instead of dotnet build /p:RestoreConfigFile=<path_to_config_file>. Also note that all build arguments will be passed down to restore.

For this, I debated not passing them along, but discussed with @emgarten and he confirmed that only restore relevant arguments will be used to decide on noop, also, there may be properties that would change the restore (like a conditional packagereference) and in this case, we do want to pass that and force a new restore. So, I believe this is the right decision here.

Also, currently, the restore verbosity is the default, even in the implicit case, which means, when doing build, you will see the restore output followed by the build output. I think I may end-up making the implicit restore output "quiet", but I am waiting to see what the output for noop restore looks like to decide.

@dotnet/dotnet-cli

@livarcocc livarcocc added this to the 2.0.0 milestone Jun 5, 2017
Copy link
Member

@emgarten emgarten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Will build eventually have all the same options as restore so that sources can be passed, or are users expected to run restore before for complex scenarios?

@livarcocc
Copy link
Author

@emgarten with the current state of the PR, they can pass the restore properties using the msbuild additional arguments. But I intend to add restore options to the commands that do implicit restore as well.

@livarcocc
Copy link
Author

@dotnet-bot Test Ubuntu x64 Release Build

@livarcocc livarcocc changed the title [WIP] Implicit restore Add Implicit restore to run/build/publish/pack/test Jun 6, 2017
@livarcocc
Copy link
Author

@dotnet-bot Test RHEL7.2 x64 Release Build
@dotnet-bot Test Windows_NT x64 Release Build

@livarcocc
Copy link
Author

@dotnet-bot Test Windows_NT x64 Release Build

@livarcocc
Copy link
Author

@MattGertz for approval

Customer scenario

This command adds implicit restore invocations to build/publish/pack/run/test. This way, the user won't have to remember to manually run restore whenever he makes a dependency change to the project.

Bugs this fixes:

https://github.com/dotnet/cli/issues/6105

Workarounds, if any

Run restore manually before the commands that use implicit restore.

Risk

Low.

Performance impact

We will run restore now before every build/run/publish/pack/test commands. So, there will be a performance impact for these commands, depending on how fast NOOP restore is. We are providing a --no-restore flag as a escape valve.

Is this a regression from a previous update?

N/A

Root cause analysis:

N/A

How was the bug found?

Planned feature.


RestoreCommandParser.AddImplicitRestoreOptions(fullBuildOptions);

return fullBuildOptions.ToArray();

This comment was marked as spam.


private IEnumerable<string> ArgsToForwardToRestore
{
get

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@nguerrera nguerrera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

CommonOptions.VerbosityOption()
};

RestoreCommandParser.AddImplicitRestoreOptions(fullBuildOptions);

This comment was marked as spam.

@livarcocc livarcocc force-pushed the implicit_restore branch 2 times, most recently from b56194a to ac1ebab Compare June 7, 2017 22:19
@nguerrera
Copy link
Contributor

Diff with ?w=1 (ignore whitespace) looks good, but there's some indentation that's off that's making the diff hard to see. Please fix it and rebase/squash.

livarcocc added 2 commits June 7, 2017 17:39
… /v was not entirely honored.

Adding tests for implicit restore for all the affected commands.

Fixing an issue where the command target was being passed to the restore command during implicit restore.

Adding restore params to all commands with implicit restore. Also, implicitly set the restore output to quiet.

Adding tests for the no-restore option.
@livarcocc livarcocc force-pushed the implicit_restore branch 4 times, most recently from f8247f1 to 3eaf727 Compare June 8, 2017 03:58
@livarcocc livarcocc merged commit 607d776 into dotnet:release/2.0.0 Jun 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants