Review Board 1.5.6

Control where packages are placed locally

Updated 1 year, 3 months ago

David Fowler Reviewers
coredevteam
215
None NuGet
Added shared repository implementation that keeps track of other repositories in an xml file within repository folder.
Added support for a nuget.config file at that can be placed anywhere within the directory hierarchy of the solution. This settings file allows users to tell the package manager where it should look for the local package repository (installed packages). It looks like this:

<settings>
    <repositoryPath>lib</repositoryPath>
</settings>

repositoryPath can be an absolute or relative path. Relative paths are resolved relative to the nuget.config file. 

Given this structure:

lib/
src/
   MySolution.sln
nuget.config
 
We start from the solution directory and walk up until we find nuget.config. If we don't find one we fall back to a "packages" folder next to the solution root.

These repositories (take the above "lib" folder for example) now look like this:

lib/
 Moq.4.0.234/
     lib/
        Moq.dll
...
repositories.config

They contain a special repositories.config file (even in the default case of no nuget.config file) which keeps track of each project that is using this repository.

<repositories>
    <repository path="..\MyProject\packages.config" />
</repositories>

Each entry has a path to a packages.config file. This is so we can remove packages from this repository when no other project is referencing it. The paths are relative by default but we support absolute paths as well.
Added unit tests for SharedRepository feature.