Alan Dean

CTO, Developer, Agile Practitioner

Photograph of Alan Dean

Wednesday, October 12, 2011

Simple NuGet Packaging

Over the last week I have started publishing my Cavity libraries on to NuGet, starting with my Unit Testing Fluent API.

The API is implemented in a single assembly with no non-BCL dependencies, which makes it the simplest case to pack for NuGet.

This is the .nuspec file:

<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>Cavity.Testing.Unit</id>
    <version>1.1.0.444</version>
    <title>Cavity Unit Testing</title>
    <authors>Alan Dean</authors>
    <owners />
    <licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
    <projectUrl>http://code.google.com/p/cavity/</projectUrl>
    <iconUrl>http://www.alan-dean.com/nuget.png</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Fluent API for asserting types and properties.</description>
    <summary />
    <copyright>Copyright © 2010 - 2011 Alan Dean</copyright>
    <language />
    <tags>TDD</tags>
    <releaseNotes>Switched off license acceptance dialog.</releaseNotes>
  </metadata>
  <files>
    <file src="lib\net35\Cavity.Testing.Unit.dll" target="lib\net35\Cavity.Testing.Unit.dll" />
    <file src="lib\net40\Cavity.Testing.Unit.dll" target="lib\net40\Cavity.Testing.Unit.dll" />
  </files>
</package>

I have implemented framework targeting in my build process, so in this case I have two assemblies (.NET 3.5 and .NET 4.0) which I have copied into the lib subdirectory.

For a simple package like this, that is all you need to configure; just pack and push.

No comments: