MSBuild
MSBuildは、マイクロソフトのビルド環境であり、通常Visual Studioと一緒に使われている。Windows Vista以降のオペレーティン�…
|
| |
| 開発元 | |
|---|---|
| 初版 | 2003年 |
| 最新版 |
18.9.6[1] |
| リポジトリ | |
| プログラミング 言語 | C# |
| 対応OS | クロスプラットフォーム |
| プラットフォーム | |
| 種別 | ビルド自動化 |
| ライセンス | MITライセンス |
| 公式サイト |
docs |
MSBuildは、マイクロソフトのビルド環境であり、通常Visual Studioと一緒に使われている。Windows Vista以降のオペレーティングシステムには、バンドルされている.NET Frameworkに対応するバージョンのMSBuildが標準的にインストールされている[2]。
MSBuildバージョン2.0は.NET Framework 2.0の一部であり、Visual Studio 2005とともに動作する。バージョン3.5は.NET 3.5(およびVisual Studio 2008)にバンドルされており、.NETプロジェクトのターゲットバージョンとして2.0、3.0、3.5をサポートしている。これは「マルチターゲット」と呼ばれる。
Visual StudioのプロジェクトおよびソリューションはMSBuildに基づいており、コンパイラやリンカ、SDKなどのツールがセットアップされていれば、Visual StudioのIDE無しでもビルドすることができる。MSBuild自体は無償で利用可能である。
Visual C++はバージョン2008までVCBuildと呼ばれる独自のビルドツールを利用していたが、バージョン2010以降はVisual C#などと同様にMSBuildを利用するようになった[3]。
MSBuildのプロジェクトファイルはApache AntやNAntに似たXMLの文法を持っている。プロジェクトファイルの文法は明確に定義されたXMLスキーマに基づいているが、基本的な構造や操作はUnixの伝統的なmakeユーティリティと同等である。すなわち、ユーザーはビルドに使われるもの(通例ソースファイル)と生成されるもの(通例スタティックライブラリ、DLL、あるいはアプリケーションの実行ファイル)を指定するが、ユーティリティはやるべき事とその順序を自分で判断する。
NMAKE
MSBuildはnmakeツールの機能的な後継である。Visual Studioには、以前のバージョンのVisual Studioで作成したプロジェクトやワークスペースを、VCBuildやMSBuildのプロジェクトやソリューションに変換する機能が用意されている。例えばVisual Studio 6におけるdsp/dswファイルを、Visual Studio .NET 2002/.NET 2003/2005/2008で開くと、それぞれvcproj/slnファイルに変換される。Visual Studio 2010以降ではvcxproj/slnファイルに変換される。
ターゲット(Target)
MSBuildではプロジェクトファイルに記述した複数のターゲットのうち、任意のターゲットを指定して実行することができる。サブシーケンスとして依存したターゲットはリクエストされたターゲット自身よりも前に実行される。各々のターゲットは自分自身を完了させるのに実行に必要なタスクをそれ自体で保持している。ターゲットは通常ひとつあるいはファイル/ディレクトリのセットに対してひとつのアクションを実行する。
タスク(Task)
タスクはターゲットを完了させるために実行されるコマンドである。タスクは通常.NETアセンブリでクラスとして実装され、Taskクラスを継承するかもしくはITaskインターフェイスを実装したものである。多数の基本的なタスクが.NET Frameworkの一部として搭載されている。またコミュニティーが開発している多くのタスクも自由に利用可能である。
プロパティおよびアイテム
付け加えてMSBuildはプロパティ(Property)およびアイテム(Item)を提供しており、Makefileのマクロと概念的に等価である。プロパティは静的な値を指定するのに対し、アイテムは通常タスクの実行対象となるファイルやフォルダのセットを定義するために使用される。ワイルドカードのサポートによりファイルをアイテムとして指定するのは容易である。
Team Foundationによるビルド
Visual Studio Team Systemも実際のTeam Buildsを達成するためにMSBuildに依存しており、Visual Studio Team Foundation Serverとして提供されている。このビルド処理はサーバー自身で実行されることはほとんどなく、必要なソフトがインストールされたリモートのビルドサーバーで実行される。(例: Team Foundation Server (Build))
参照
- Inside the Microsoft Build Engine :Using MSBuild and Team Foundation Build (Microsoft Press)
- “MSDN - The MSBuild Reference”. 2008年3月18日時点のオリジナルよりアーカイブ。2023年6月2日閲覧。
- “Team Foundation Build overview”. 2013年1月4日時点のオリジナルよりアーカイブ。2023年6月2日閲覧。
- Popular MSBuild Blog
- Open Source MSBuild Community Tasks Project
- Inside MSBuild MSDN Article
- WiX Tricks-Automate Releases With MSBuild And Windows Installer XML
- MSBuild : Best Practices For Creating Reliable Builds, Part 1 (MSDN Magazine)
- MSBuild : Best Practices For Creating Reliable Builds, Part 2 (MSDN Magazine)
- MSBuild Sidekick - GUI editor and debugger for MSBuild scripts
- MSBuild Wiki
- MSBuild Command Line Reference - parameters & switches
脚注
- ^ “Release 18.9.6” (2026年8月11日). 2026年8月11日閲覧。
- ^ OSに標準付属のMSBuildツールでプロジェクトをビルドするには?:.NET TIPS - @IT
- ^ VCBuild vs. MSBuild | Microsoft Learn
関連項目
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.