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