Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --legacy-packages-directory to Xplat restore #814

Merged
merged 1 commit into from Aug 9, 2016

Conversation

joelverhagen
Copy link
Member

Add a new switch --legacy-packages-directory to NuGet.CommandLine.Xplat (i.e. dotnet restore) which allows the caller to restore to the packages folder folders with original case ID and version.

Since the correct format of the global packages folder is {root}/{lowercase-id}/{lowercase-version}, this is done by first restoring to lowercase folder names then, as a post-process step to the restore operation, copy the packages to {root}/{original-id}/{original-version}. This allows the legacy mode to be minimally invasive to the main restore operation.

This command line option is part of a backwards compatibility story so that 1.0.0 Corehost can still find packages restored by newer version of NuGet.

Corehost reads a .deps.json file generated by .NET CLI. .NET CLI generates the .deps.json file from the project.lock.json file that we write out. When the --legacy-packages-directory switch is passed, the lock file written out has the path property of each package library converted from lowercase to original case.

Next steps are modifying CLI to include the path property in the .deps.json file and modifying Corehost to prefer this path property over the concatenation of the library ID + library version.

@emgarten @alpaix @rohit21agrawal @rrelyea

@@ -88,6 +94,8 @@ internal static class RestoreCommand

using (var cacheContext = new SourceCacheContext())
{
var legacyPackagesDirectory = legacyPackagesDirectoryOption.HasValue();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit. isLegacyPackagesDirectory

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@emgarten
Copy link
Member

emgarten commented Aug 9, 2016

xplat restore is dead 💀

@alpaix
Copy link
Contributor

alpaix commented Aug 9, 2016

lgtm :shipit:

@emgarten
Copy link
Member

emgarten commented Aug 9, 2016

Looks great! 👏 :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants