en-US/about_Whiskey_DotNetPublish_Task.help.txt

TOPIC
    about_Whiskey_DotNetPublish_Task
 
SUMMARY
    Builds and publishes a .NET Core project and all its dependencies for deployment.
 
DESCRIPTION
    The `DotNetPublish` tasks runs the `dotnet publish` command which packages the application and its dependencies into a folder for deployment. Your application won't run until you've published it. Pass a list of solutions 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 build those. If the `dotnet publish` command returns a non-zero exit code (i.e. compilation error), the build will fail.
 
    The task will automatically use the following options with the `dotnet publish` command and are not modifiable:
 
        * `--configuration=(Debug|Release)`: `Debug` when build run by a developer and `Release` when build run by a build server.
        * `-p:Version=$(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.
 
    The task writes a detailed build log to the build output directory. If the `Path` property has no value, the file is named `dotnet.publish.log`. Otherwise, there will be a log file for each path named `dotnet.publish.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 publish` command.
    * `Path`: a list of paths to .NET Core solution or project files to build. If not specified, any solution or project files in the task working directory will be built.
    * `OutputDirectory`: the output directory for the published artifacts. If not specified, it defaults to `[project OutputPath property]/publish/` for a framework-dependent deployment or `[project OutputPath property]/[runtime]/publish/` for a self-contained deployment. Path must be relative to the project file location.
    * `SdkVersion`: the version of the .NET Core SDK to use to build 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 value 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.
    * `Verbosity`: sets the verbosity level of `dotnet` output. For developers, the default is dotnet'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:
        - DotNetPublish
 
    Demonstrates running the `dotnet publish` command with no arguments which builds and publishes any .NET Core solution or project files found in the same directory as the whiskey.yml.
 
    ## Example 2
 
        Build:
        - DotNetPublish:
            Path:
            - src\App\DotNetCoreApp.csproj
            - src\Backend\DotNetCoreBackend.csproj
            OutputDirectory: bin
 
    Demonstrates building a .NET Core project file and publishing binaries to the "$(WHISKEY_BUILD_ROOT)\src\App\bin" and "$(WHISKEY_BUILD_ROOT)\src\Backend\bin" directories respective to each project file's root directory.
 
    ## Example 3
 
        Build:
        - DotNetPublish:
            Argument: --self-contained
            Verbosity: diagnostic
 
    Demonstrates building and publishing with "diagnostic" verbosity and with an additional argument, `--self-contained`, passed to the `dotnet publish` command.
 
    ## Example 4
 
        Build:
        - DotNetPublish:
            Path: DotNetCoreSolution.sln
            SdkVersion: 2.*
 
    Demonstrates building and publishing a .NET Core solution using the latest "2.*" version of the .NET Core SDK.