MSBuild タスクを設定する方法は次のとおりです。
- ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
- 目的の MSBuild タスクの名前をクリックするか、新しくタスクを作成する場合は、タスクの追加をクリックし、MSBuild をクリックします。
Complete the following settings:
MSBuild 構成 タスクの説明 A description of the task, which is displayed in Bamboo. 実行可能ファイル タスクの実行に利用可能な MSBuild 実行可能ファイル。選択した実行可能ファイルは、タスク(またはジョブなど)の要件の1つとなります。
You can add other executables, if required.
プロジェクト ファイル The name of the solution, project file or MSBuild project to execute, for example ExampleSolution.sln. You can include variables (see Bamboo variables).オプション 含める MSBuild のコマンド ライン オプション。
By default, Bamboo 5.7 (and later versions) writes the contents of the Projects File and Options fields to an MSBuild response file. See below for more information.
You can include variables (see Bamboo variables).
必要に応じて、環境変数と作業ディレクトリの設定を指定します。
環境変数 (Optional) Additional system environment variables that you want to pass to your build. Note that existing environment variables are automatically available to the executable. You can also include Bamboo global or build-specific variables (see Bamboo variables).
Multiple variables should be separated with spaces. Parameters with spaces must be quoted (e.g ANT_OPTS="-Xms200m -Xmx700m").Working Sub Directory (オプション) Bamboo が実行ファイルを実行する、ジョブのルート ディレクトリに相対的な代替サブディレクトリ。ルート ディレクトリには、ジョブの構成済みソース リポジトリから確認されたものがすべて含まれます。このフィールドを空白のまま残した場合、Bamboo はルート ディレクトリでビルド ファイルを検索します。このオプションは、サブディレクトリ内にビルド スクリプトがあり、実行可能ファイルをそのサブディレクトリ内から実行する必要がある場合に便利です。 Powershell スクリプトとして実行 (オプション、Windows のみ).bat ファイルを解釈する cmd.exe ではなく Powershell でスクリプトを実行するには、「Powershell スクリプトとして実行」チェックボックスをチェックします。インライン エディタは Powershell 構文をサポートします。 - 保存をクリックします。
MSBuild にオプションを渡す
By default, Bamboo 5.7 (and later versions) writes the contents of the Projects File and Options fields to an MSBuild response file:
# MSBuild response file generated by Atlassian Bamboo %CONTENTS_OF_OPTIONS_FIELD% %CONTENTS_OF_PROJECTS_FILE_FIELD%
そして以下のコマンドを実行します。
msbuild.exe @<full-path-to-response-file>response-file.rsp
これによって、コマンド ラインで MSBuild を呼び出すときに使用するものと同じ設定を Bamboo MSBuild で使用することができます。
You can disable creation of the response file. In that case, Bamboo will create a .bat file instead:
"<full-path-to-msbuild>msbuild.exe" %CONTENTS_OF_OPTIONS_FIELD% %CONTENTS_OF_PROJECTS_FILE_FIELD%
and run that.
