MSBuild

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

このページでは、MSBuild 実行可能ファイルを使用する Bamboo タスクの設定方法を説明します。

 

MSBuild ビルドのコード カバレッジ収集には Clover を使用できません。Clover は Ant、Maven、Grails などの Java/Groovy ベースのプロジェクトのビルダーのみをサポートしているためです。

 

MSBuild タスクを設定する方法は次のとおりです。

  1. ジョブのタスク設定タブに移動します(新しいプランを作成するとデフォルト ジョブとなります)。
  2. 目的の MSBuild タスクの名前をクリックするか、新しくタスクを作成する場合は、タスクの追加をクリックし、MSBuild をクリックします。
  3. Complete the following settings:

    MSBuild 構成
    タスクの説明A description of the task, which is displayed in Bamboo.
    実行可能ファイル

    タスクの実行に利用可能な MSBuild 実行可能ファイル。選択した実行可能ファイルは、タスク(またはジョブなど)の要件の1つとなります。

    You can add other executables, if required.

    プロジェクト ファイル
    実行するソリューション、プロジェクト ファイル、または MSBuild プロジェクトの名前 (例: ExampleSolution.sln)。変数を含めることもできます (「Bamboo 変数」を参照)。
    オプション

    含める 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.

    変数を含めることもできます(「Bamboo 変数」を参照してください)。

     

  4. 必要に応じて、環境変数と作業ディレクトリの設定を指定します。

    環境変数

    (オプション)ビルドに渡す追加システム環境変数。既存の環境変数は、実行ファイルで自動的に利用できます。また、Bamboo グローバルまたはビルド固有の変数を含めることもできます(Bamboo 変数を参照)。
    複数の変数はスペースで区切ってください。パラメーターには引用符を付けてください (例: ANT_OPTS="-Xms200m -Xmx700m")。

    Working Sub Directory(オプション)  Bamboo が実行ファイルを実行する、ジョブのルート ディレクトリに相対的な代替サブディレクトリ。ルート ディレクトリには、ジョブの構成済みソース リポジトリから確認されたものがすべて含まれます。このフィールドを空白のまま残した場合、Bamboo はルート ディレクトリでビルド ファイルを検索します。このオプションは、サブディレクトリ内にビルド スクリプトがあり、実行可能ファイルをそのサブディレクトリ内から実行する必要がある場合に便利です。
    Powershell スクリプトとして実行(オプション、Windows のみ).bat ファイルを解釈する cmd.exe ではなく Powershell でスクリプトを実行するには、「Powershell スクリプトとして実行」チェックボックスをチェックします。インライン エディタは Powershell 構文をサポートします。

  5. 保存をクリックします。

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.

Click here to see how to disable use of the response file...

To disable use of the MSBuild response file, set the bamboo.plugin.dotnet.msbuild.useResponseFile system property to false.

There are a couple of ways to do that:

  • If you start the Bamboo server or remote agents manually you can set the property on the command line, as an argument to the JVM, like this:

    -Dbamboo.plugin.dotnet.msbuild.useResponseFile=false

    Do this on all Bamboo agents, and on the Bamboo server if you use local agents.

  • If your agents are run as a service, set the system property in the <Bamboo agent home directory>/conf/wrapper.conf configuration file, like this:

    # The Bamboo Agent home configuration file
    wrapper.java.additional.1=-Dbamboo.home=/home/bamboo/bamboo-agent-home
    wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false
    wrapper.java.additional.3=-Dbamboo.plugin.dotnet.msbuild.useResponseFile=false
  • If your Bamboo server runs as a service, add the system property to the <Bamboo home directory>/conf/wrapper.conf  configuration file.

 

 

 

 

 

最終更新日 2017 年 5 月 19 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.