NuGetAliases.

NuGetPack(ICakeContext, FilePath, NuGetPackSettings) Method

Summary

Creates a NuGet package using the specified nuspec or project file.
Namespace
Cake.Common.Tools.NuGet
Containing Type
NuGetAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Pack")]
[CakeNamespaceImport("Cake.Common.Tools.NuGet.Pack")]
public static void NuGetPack(this ICakeContext context, FilePath filePath, NuGetPackSettings settings)

Examples

     var nuGetPackSettings   = new NuGetPackSettings {
                                     Id                      = "TestNuGet",
                                     Version                 = "0.0.0.1",
                                     Title                   = "The tile of the package",
                                     Authors                 = new[] {"John Doe"},
                                     Owners                  = new[] {"Contoso"},
                                     Description             = "The description of the package",
                                     Summary                 = "Excellent summary of what the package does",
                                     ProjectUrl              = new Uri("https://github.com/SomeUser/TestNuGet/"),
                                     IconUrl                 = new Uri("http://cdn.rawgit.com/SomeUser/TestNuGet/master/icons/testNuGet.png"),
                                     LicenseUrl              = new Uri("https://github.com/SomeUser/TestNuGet/blob/master/LICENSE.md"),
                                     Copyright               = "Some company 2015",
                                     ReleaseNotes            = new [] {"Bug fixes", "Issue fixes", "Typos"},
                                     Tags                    = new [] {"Cake", "Script", "Build"},
                                     RequireLicenseAcceptance= false,
                                     Symbols                 = false,
                                     NoPackageAnalysis       = true,
                                     Files                   = new [] {
                                                                          new NuSpecContent {Source = "bin/TestNuGet.dll", Target = "bin"},
                                                                       },
                                     BasePath                = "./src/TestNuGet/bin/release",
                                     OutputDirectory         = "./NuGet"
                                 };

     NuGetPack("./nuspec/TestNuGet.nuspec", nuGetPackSettings);

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.
CakeNamespaceImportAttribute An attribute used to hint Cake about additional namespaces that need to be imported for an alias to work. This attribute can mark an extension method, the extension method class, or the assembly to provide a global set of imports.

Parameters

Name Type Description
context ICakeContext The context.
filePath FilePath The nuspec or project file path.
settings NuGetPackSettings The settings.

Return Value

Type Description
void