en-US/about_Whiskey_DotNetPack_Task.help.txt

TOPIC
    about_Whiskey_DotNetPack_Task
 
SUMMARY
    Creates a NuGet package from a .NET Core project.
 
DESCRIPTION
    The `DotNetPack` tasks runs the `dotnet.exe pack` command to create a NuGet package from .NET projects targeting .NET Core and .NET Standard. Pass a list of solution files or .NET Core project files to the `Path` property. If no files are provided to `Path`, then the .NET Core SDK will search for any solution or project files in the working directory and create packages for those. If the `dotnet.exe pack` command returns a non-zero exit code the build will fail.
 
    The task will automatically apply the following switches to the `dotnet.exe pack` command and are not modifiable:
 
        * `--configuration=(Debug|Release)`: `Debug` when build run by a developer and `Release` when build run by a build server.
        * `--output=$(WHISKEY_OUTPUT_DIRECTORY)`: The default Whiskey build output directory.
        * `-p:PackageVersion=$(WHISKEY_VERSION_SEMVER1)`: The semver version 1 version for the current build. Use a `Version` task in your whiskey.yml file to set the version number.
        * `--no-build`: Skip building the project prior to packaging.
        * `--no-dependencies`: Ignore project to project references and only restore root project.
        * `--no-restore`: Does not do an implicit restore when executing `dotnet.exe pack`.
 
    The task writes a detailed build log to the build output directory. If the `Path` property has no value, the file is named `dotnet.pack.log`. Otherwise, there will be a log file for each path named `dotnet.pack.FILE_NAME.log`, where `FILE_NAME` is the name of the file built.
 
PROPERTIES
    * `Argument`: a list of additional arguments to pass to the `dotnet.exe pack` command.
    * `Path`: a list of paths to .NET Core solution or project files to create NuGet packages from. If not specified, any solution or project files in the task working directory will be packaged.
    * `SdkVersion`: the version of the .NET Core SDK to use to package the project. Supports wildcard values. If not specified, the task will look for the SDK version from the `global.json` file if it is found in the task working directory or the Whiskey build root. If no SDK version can be located, the task will default to using the SDK version that comes with the latest LTS release of the .NET Core runtime. Whiskey will *always* update the SDK version property in the `global.json` file with the SDK version that task is running with. If no `global.json` file exists, one will be created in the Whiskey build root.
    * `Symbols`: a boolean value indicating whether or not to also create a package with symbols. The symbols package will be created next to the regular package in the build output directory. Defaults to `false`.
    * `Verbosity`: sets the verbosity level of dotnet.exe's output. For developers, the default is dotnet.exe's default verbosity. On build servers, the default is `detailed`. Allowed values are `q[uiet]`, `m[inimal]`, `n[ormal]`, `d[etailed]`, and `diag[nostic]`.
 
EXAMPLES
 
    ## Example 1
 
        Build:
        - DotNetPack:
            Path:
            - DotNetCoreSolution.sln
 
    Demonstrates creating a NuGet package for all projects in the DotNetCoreSolution.sln solution file with the `dotnet pack` command.
 
    ## Example 2
 
        Build:
        - DotNetPack:
            Path:
            - DotNetCoreSolution.sln
            Symbols: true
            Verbosity: normal
 
    Demonstrates creating a NuGet regular package and symbols package for all projects within a solution file and running `dotnet pack` with normal verbosity.
 
    ## Example 3
 
        Build:
        - DotNetPack:
            Path:
            - src\DotNetStandardLibrary.csproj
            - src\DotNetCoreApp.csproj
            Argument:
            - --include-source
 
    Demonstrates creating a NuGet package for multiple projects found in the `$(WHISKEY_BUILD_ROOT)\src` directory while also passing the additional argument `--include-source` to the `dotnet pack` command.
 
    ## Example 4
 
        Build:
        - DotNetPack:
            Path:
            - DotNetCoreSolution.sln
            SdkVersion: 2.*
 
    Demonstrates creating a NuGet package using the latest `2.*` version of the .NET Core SDK.