NuGetPackager@0 - NuGet packager v0 タスク

NuGetPackager@0は非推奨です。 代わりに NuGet タスクを使用してください。 新しいツール インストーラー フレームワークで動作するため、タスクの更新を待たずに新しいバージョンの NuGet を簡単に使用でき、このorganization/コレクション外の認証済みフィードのサポートが向上し、既定では NuGet 4 が使用されます。

NuGetPackager@0は非推奨です。 代わりに NuGet タスクを使用してください。 新しいツール インストーラー フレームワークで動作するため、タスクの更新を待たずに新しいバージョンの NuGet を簡単に使用でき、このアカウント/コレクション外の認証済みフィードのサポートが向上し、既定では NuGet 4 が使用されます。

構文

# NuGet packager v0
# Deprecated: use the “NuGet” task instead. It works with the new Tool Installer framework so you can easily use new versions of NuGet without waiting for a task update, provides better support for authenticated feeds outside this organization/collection, and uses NuGet 4 by default.
- task: NuGetPackager@0
  inputs:
    searchPattern: '**\*.csproj' # string. Required. Path to csproj or nuspec file(s) to pack. Default: **\*.csproj.
    #outputdir: # string. Package Folder. 
  # Pack options
    #includeReferencedProjects: false # boolean. Include referenced projects. Default: false.
    versionByBuild: 'false' # 'false' | 'byPrereleaseNumber' | 'byEnvVar' | 'true'. Required. Automatic package versioning. Default: false.
    #versionEnvVar: # string. Required when versionByBuild = byEnvVar. Environment variable. 
    #requestedMajorVersion: '1' # string. Required when versionByBuild = byPrereleaseNumber. Major. Default: 1.
    #requestedMinorVersion: '0' # string. Required when versionByBuild = byPrereleaseNumber. Minor. Default: 0.
    #requestedPatchVersion: '0' # string. Required when versionByBuild = byPrereleaseNumber. Patch. Default: 0.
  # Advanced
    #configurationToPack: '$(BuildConfiguration)' # string. Configuration to Package. Default: $(BuildConfiguration).
    #buildProperties: # string. Additional build properties. 
    #nuGetAdditionalArgs: # string. NuGet Arguments. 
    #nuGetPath: # string. Path to NuGet.exe.
# NuGet Packager v0
# Deprecated: use the “NuGet” task instead. It works with the new Tool Installer framework so you can easily use new versions of NuGet without waiting for a task update, provides better support for authenticated feeds outside this account/collection, and uses NuGet 4 by default.
- task: NuGetPackager@0
  inputs:
    searchPattern: '**\*.csproj' # string. Required. Path to csproj or nuspec file(s) to pack. Default: **\*.csproj.
    #outputdir: # string. Package Folder. 
  # Pack options
    #includeReferencedProjects: false # boolean. Include referenced projects. Default: false.
    versionByBuild: 'false' # 'false' | 'byPrereleaseNumber' | 'byEnvVar' | 'true'. Required. Automatic package versioning. Default: false.
    #versionEnvVar: # string. Required when versionByBuild = byEnvVar. Environment variable. 
    #requestedMajorVersion: '1' # string. Required when versionByBuild = byPrereleaseNumber. Major. Default: 1.
    #requestedMinorVersion: '0' # string. Required when versionByBuild = byPrereleaseNumber. Minor. Default: 0.
    #requestedPatchVersion: '0' # string. Required when versionByBuild = byPrereleaseNumber. Patch. Default: 0.
  # Advanced
    #configurationToPack: '$(BuildConfiguration)' # string. Configuration to Package. Default: $(BuildConfiguration).
    #buildProperties: # string. Additional build properties. 
    #nuGetAdditionalArgs: # string. NuGet Arguments. 
    #nuGetPath: # string. Path to NuGet.exe.

入力

searchPattern - パックする csproj または nuspec ファイルへのパス
string. 必須です。 既定値: **\*.csproj

タスクがパックするファイルまたは nuspec ファイルをcsproj検索するために使用するパターン。

セミコロンで複数のパターンを区切ることができます。パターンの前に -: を付けることで否定のパターンにすることができます。 例: **\*.csproj;-:**\*.Tests.csproj.


outputdir - パッケージ フォルダー
string.

タスクによってパッケージが作成されるフォルダー。 この文字列が空の場合、 または nuspec ファイルが配置されているフォルダーにパッケージがcsproj作成されます。


includeReferencedProjects - 参照されているプロジェクトを含める
boolean. 既定値: false

参照されているプロジェクトを依存関係として、またはパッケージの一部として含めます。 パッケージの自動バージョン管理では使用できません。 参照先プロジェクトに、プロジェクトと同じ名前の対応する nuspec ファイルがある場合、その参照プロジェクトは依存関係として追加されます。 それ以外の場合は、参照先プロジェクトがパッケージの一部として追加されます。 NuGet CLI の pack コマンドを使用して NuGet パッケージを作成する方法の詳細を確認してください。


versionByBuild - パッケージの自動バージョン管理
string. 必須です。 使用できる値: false (Off)、 byPrereleaseNumber (日付と時刻を使用)、 byEnvVar (環境変数を使用) true 、(ビルド番号を使用)。 既定値: false

指定した値に応じて、パッケージの自動バージョン管理を適用します。 この文字列は と共に includeReferencedProjects使用できません。 使用できる値は、次のとおりです。

  • byPrereleaseNumber - 日付と時刻を使用する: タスクでは、 としてX.Y.Z-ci-datetime書式設定された SemVer 準拠バージョンが生成されます。ここで、X、Y、および Z の値を指定します。
  • byEnvVar- 環境変数を使用する: タスクでは、指定した環境変数が使用され、使用するバージョン番号が含まれます。
  • true - ビルド番号を使用する: タスクでは、ビルド番号を使用してパッケージのバージョンを設定します。

Note

[全般] で、ビルド形式を に $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)設定します。


versionEnvVar - 環境変数
string. versionByBuild = byEnvVar の場合に必要です。

、、または %を使用せずに$$env変数名を指定します。


requestedMajorVersion - 主要
string. versionByBuild = byPrereleaseNumber の場合に必要です。 既定値: 1

Xバージョン X.Y.Z の


requestedMinorVersion - マイナー
string. versionByBuild = byPrereleaseNumber の場合に必要です。 既定値: 0

Yバージョン X.Y.Z の


requestedPatchVersion - パッチ
string. versionByBuild = byPrereleaseNumber の場合に必要です。 既定値: 0

Zバージョン X.Y.Z の


configurationToPack - パッケージへの構成
string. 既定値: $(BuildConfiguration)

ファイルを使用するときにパッケージ化する構成を csproj 指定します。


buildProperties - 追加のビルド プロパティ
string.

パッケージのビルドに使用されるプロパティのセミコロン区切りリスト。


nuGetAdditionalArgs - NuGet 引数
string.

NuGet.exe pack渡される追加の引数。 NuGet CLI の pack コマンドを使用して NuGet パッケージを作成する方法の詳細を確認してください。


nuGetPath - NuGet.exeへのパス
string.

省略可能。 へのパスを指定 NuGet.exeします。


タスク制御オプション

すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「 コントロール オプションと一般的なタスク プロパティ」を参照してください。

出力変数

[なし] :

必要条件

要件 説明
パイプラインの種類 YAML、クラシック ビルド、クラシック リリース
上で実行 エージェント、DeploymentGroup
確認要求 セルフホステッド エージェントには、このタスクを使用するジョブを実行するための次の要求に一致する機能が必要です。
Capabilities このタスクは、ジョブ内の後続のタスクに対する要求を満たしていません。
コマンドの制限 Any
設定可能な変数 Any
エージェントのバージョン 1.83.0 以上
タスクのカテゴリ パッケージ