buildmagic /

Filename Size Date modified Message
7 B
1.7 KB
730 B
4.4 KB
2.1 KB

BuildMagic

BuildMagic downloads NuGet packages on every build without requiring NuGet.exe or any other binaries to be comitted to your repository.

DISCLAIMER: this is experimental software that may not work as advertised. In particular, it has not been tested on Mono. Please help us improve it by sending feedback and fixes.

The Problem

If you are using NuGet the current recommended practice is to enable "package restore" feature that makes NuGet download packages during build, allowing you to leave the binaries out of the source control repository.

Unfortunately, there is a small problem. You still have to commit the 600K NuGet.exe file. Moreover, you will have to commit new versions of it every time NuGet itself changes.

The Solution

Enter BuildMagic. This little package bootstraps NuGet.exe by downloading and unpacking it, then proceeds to use it to restore packages. Downloading and unpacking is implemented as MSBuild inline C# tasks. With BuildMagic you still have to commit an extra .targets file to your repository, but you do not have to commit any binaries.

Usage

Use NuGet to add BuildMagic to your solution. Ignore the .nuget/bin folder but commit .nuget/BuildMagic.targets to source control. Your build should now succeed on the build server or hosted environment like AppHarbor without comitting any NuGet package binaries or NuGet.exe.

Source Code

The source code repository is:

http://bitbucket.org/IntelliFactory/buildmagic

To build, run NuGet.exe pack.

Bugs and Feedback

Please use the issues tracker at:

http://bitbucket.org/IntelliFactory/buildmagic/issues

Acknowledgements

The PowerShell script is inspired by Daniel Cazulino's blog. When constructing the MSBuild code the NuGet.Build targets responsible for NuGet package restore were a helpful reference.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.