The project https://github.com/SimonCropp/Pepita
Using Nuget to get dependencies
So, like most people using .net, I have started to make use of Nuget. However there is one area/feature that it is currently lacking in: Helping you avoid checking in binaries. Here is the feature request http://nuget.codeplex.com/workitem/165
The current workaround I have been using was first described by David Ebbo http://blog.davidebbo.com/2011/03/using-nuget-without-committing-packages.html. And later clarified by José F. Romaniello http://joseoncode.com/2011/05/31/nuget-keep-your-package-folder-out-of-your-cvs/.
This essentially involves having 1 binary dependency “Nuget.exe”. Then as part of the build ensuring packages are downloaded before they are used. This has been satisfactory for a while but eventually I started to think it could be better. The problems are as follows
- Nuget.exe at 405KB is relatively large.
- Although not a major problem Nuget.exe is relatively slow. On my machine it takes approx. 160ms (per project) to check for dependencies. This is only a big issue if you have a solution with many projects.
- The syntax for setting it up is fairly verbose
<Exec Condition="Exists('$(ProjectDir)packages.config')" Command='"$(SolutionDir)Tools\nuget.exe" install "$(ProjectDir)packages.config" -o "$(SolutionDir)Packages"' />
So I built PepitaGet
It is a lightweight exe that has 1 purpose. To ensure your packages exist as part of a build. With this very limited requirement I am able to optimise the process. The result is:
- It is small. Currently around 10KB.
- Fast. Runs in approx. half the time Nuget.exe does
- Simple to setup.
Still early days
The current version is 0.1 so it is still early days. So far I have moved 4 of my Open Source projects over. So it gets the “Works on my machine” and “Works on the build server” badges.
So have a play and tell me what you think.
No new comments are allowed on this post.