VSoft Technologies Blogs

rss

VSoft Technologies Blogs - posts about our products and software development.

NuGet is a open source package management tool for .NET applications. It allows you to very simply install, create and share reusable assemblies. With the latest release, FinalBuilder now contains a set of actions to help you interact with NuGet as part of your automated build process.

 

First things first

To get started, you'll need to download nuget.exe from codeplex. Optionally, if you'd like to Push or Delete to nuget.org you will need an APIKey. You can get one by creating an account at nuget.org and going to the My Account page.

Once you have those, in FinalBuilder go to Tools -> Options and under .Net Tools select NuGet. Set the path to the folder where nuget.exe is located and if you have an API Key, add it in as well.

 

Installing packages

If you use nHibernate, jQuery or any of the 1500 other packages that are available from nuget.org, you can use the NuGet Install action to keep your build process up to date. This is particularly useful if you're using FinalBuilder on a continious integration server such as FinalBuilder Server.

You can install from the default (nuget.org) server or your own custom package feed. Having your CI server pull down the latest version of a third party library is a quick and easy way to see if the latest version has any breaking changes for your codebase. If it does, you can choose to install a specific version until you've modified your code to be compatable with the changes.

 

Sharing packages

If you develop an open source library for .NET and want people to use it, it makes a lot of sense to have it published on NuGet. And if you use FinalBuilder to build the library, it's pretty simple to add publishing into your build process. Or, if you have a lot of shared internal assemblies and are looking for a better way to distribute them, publishing to an internal NuGet server may make your life a lot easier.

FinalBuilder has 4 actions to help with the publishing process. If you're familiar with using nuget.exe from the command line they should be very familiar.

The Spec action creates a .nuspec file - either with placeholder data or with metadata from a project file (.csproj) or an assembly. The nuspec is an XML file, so after you've created it you can use FinalBuilder's XML actions to easily manipulate it.

The Pack action creates a .nupgk file from your nuspec, ready for deployment. Alternatively, you can create a package directly from a project file. The Pack action lets you choose which project configuration to use (if you're using a csproj), override the version number and use a pattern to exclude files from the package.

Once you have your nupkg, you can use the Push action to publish it to either the default server on nuget.org, or to your custom NuGet server. If you prefer, you can upload but not publish the package. That way you can manually go to the site and press the Go button before anyone will see it.

Lastly there's the Delete action, which removes the package you specify from the server.

 

Further information

NuGet.org is the place to go any lots more information. Scott Hanselman also has an excellent presentation that covers everything you should need to know (although we disagree with his choice of build automation tools :) )

Showing 4 Comments

Avatar
Neil Barnwell 13 years ago

I think there might be a bug in the way the "configuration" argument is passed. FinalBuilder seems to pass it as 'nuget pack -Configuraion "Release"', but from the docs at <a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package" rel="nofollow">docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package</a>, it seems it should be 'nuget pack -Prop Configuration=Release'.<br><br>Can you confirm if this is a problem, and if so when there might be a fix, please?<br><br>Warm regards,<br><br>Neil.


Avatar
Ben Hughes 13 years ago

Hi Neil,<br>Thanks for pointing this out. I've just uploaded a build with the fix, which you can get here: <a href="http://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1406.exe" rel="nofollow">www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1406.exe</a><br><br>Please let me know if it doesn't work as you'd expect.<br><br>Cheers,<br><br>Ben


Avatar
Ben Hughes 13 years ago

Hi Nelson,<br>Glad to hear that you're interested :)<br><br>The actions are in yesterday's release - 7.0.0.1283 - which you can grab from the downloads page: <a href="http://www.finalbuilder.com/download.aspx" rel="nofollow">www.finalbuilder.com/download.aspx</a><br><br>Cheers,<br><br>Ben


Avatar
Nelson Wolf 13 years ago

Hi Ben,<br><br>Very cool! I've been discussing the use of NuGet packages with our developers and it's cool to see FB add these actions.<br><br>What version of FB are these new actions available in?<br><br>-Nelson



Comments are closed.