Skip to content
haf edited this page Dec 15, 2014 · 15 revisions

This task type will automatically construct nuget packages for each of the projects you've given it as an Enumerable (the assignment to #files).

It will use the metadata that's already available in the xxproj-file to construct the nuget metadata, instead of forcing you to populate a nuspec file manually.

You can override the metadata by setting values inside #with_metadata.

The project's <Name /> element will map to the id and title nuspec attributes, unless an Id element has been given, in which case it will map to the id nuspec attribute, and <Title /> to the title nuspec attribute.

nugets_pack :create_nugets do |p|
  p.configuration = 'Release'
  p.files   = FileList['src/**/*.{csproj,fsproj,nuspec}'].
    exclude(/Tests/)
  p.out     = 'build/pkg'
  p.exe     = 'buildsupport/NuGet.exe'
  p.with_metadata do |m|
    m.description = 'A cool nuget'
    m.authors = 'Henrik'
    m.version = ENV['NUGET_VERSION']
  end
  p.with_package do |p|
    p.add_file 'file/relative/to/proj', 'lib/net40'
  end
end

The available metadata properties are in the nuspec specification. Translate the camel case property to snake case. You can also browse the albacore code to a list.

nugets_pack Config##no_project_dependencies

Cancel following of references between projects that cause nugets_pack to find and add as nuget dependencies, linked projects.

Clone this wiki locally