Table of Contents

Class DotnetPackAndStageOptions

Namespace
Invex.Atom.Module.Dotnet.Helpers
Assembly
Invex.Atom.Module.Dotnet.dll
public sealed record DotnetPackAndStageOptions
Inheritance
object
DotnetPackAndStageOptions

Constructors

DotnetPackAndStageOptions()

public DotnetPackAndStageOptions()

Properties

ClearPublishDirectory

Gets or sets a value indicating whether to clear the publish directory before staging the new package.

public bool ClearPublishDirectory { get; init; }

Property Value

bool

Remarks

If true, the target publish directory for the NuGet package will be deleted and recreated before moving the new package. Defaults to true.

CustomPropertiesTransform

Gets or sets a custom transformation function to apply to project property files before packing.

public Func<string, string>? CustomPropertiesTransform { get; init; }

Property Value

Func<string, string>

Remarks

This function can be used to modify the content of .csproj or .props files (e.g., to inject custom properties or modify existing ones) during the packing process.

PackOptions

Gets or sets the specific options to pass to the dotnet pack command.

public DotnetPackOptions? PackOptions { get; init; }

Property Value

DotnetPackOptions

PackageFileName

Gets or sets the file name of the package to stage, such as MyTool.linux-x64.1.2.3.nupkg.

public string? PackageFileName { get; init; }

Property Value

string

Remarks

Set this when `dotnet pack` writes more than one package for the project, for example a RID-specific tool that produces a top-level package and one package per runtime. The named package is staged and the others are left in the build directory. Staging fails if no package with this name was produced.

When null (the default), the last {project}.*.nupkg file in ordinal order is staged.

SetVersionsFromProviders

Gets or sets a value indicating whether to automatically set project versions from the build version providers (BuildVersion).

public bool SetVersionsFromProviders { get; init; }

Property Value

bool

Remarks

If true, the module will attempt to inject the build version into project files before packing. Defaults to true.