MSBuild


Every development team should adopt MSBuild.exe as quickly as possible. This tool will eventually replace every build engine that Microsoft currently has available. In Chapter 5, I discuss in detail ("In Steps the 800-Pound Gorilla!") the different build tools that Microsoft ships. The current plan is to consolidate all the current build tools (MSBuild, VCBuild, and Devenv) into MSBuild as a part of Orcas (the codename for the release after VS 2005). This is likely to change, but that is the plan for now. Let's talk about MSBuild a little more.

Christope Nasarre has written a great three-part article about MSBuild that is available on MSDN at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/msbuildpart1.asp. You should read all three parts if you would like a detailed overview on the product. The site also provides samples that you can download. The following explanation on the basic functionality of MSBuild is taken from "Part 1: From a Project Author's Perspective."

Basic MSBuild Definitions

The visible side of MSBuild is the msbuild.exe console application that consumes, or uses, project or solution files to build. This executable is just a thin wrapper that translates its command line and drives the real engine hosted by MSBuildEngine.dll. The execution engine is responsible for synchronously running a project composed of tasks defined in an XML project file. Tasks are listed under targets so that you can organize them the way you want. Tasks can take input from properties or items and generate their own output items. Properties are key/value pairs that correspond to the following:

  • Environment variables

  • Definitions in the project file

  • Command-line arguments passed to msbuild.exe using /p

To create a build process, you usually define a set of files to be given to compilers or linkers; therefore, you can define such an array of items in a project file. A task takes input from properties and items, but produces output that can be consumed as input by the next task in the project. You frequently need to set parameter values in a specific way for example, according to conditions, such as a DEBUG or a RELEASE configuration.

MSBuild consumes project files written in XML that adhere to a schema described by msbuild.xsd. The XML elements correspond to the notions of project, target, task, property, item, and conditions just introduced. This 16KB file is found in the same folder as the command-line tool msbuild.exe: the common language runtime (CLR) folder hosted in the %Sysroot%\Microsoft.NET\Framework\v1.2.xxxxxx subdirectory. Microsoft is committed to supporting this format in the long run, and its simplicity provides a valid reason to be confident in it.

Note

XMake is the internal code name for MSBuild, so the two terms are synonymous.


This is just a small snippet of the information available at the link at the beginning of this section. Spend a few weeks evaluating the MSBuild. exe tool to see if you can move your builds to it.



The Build Master(c) Microsoft's Software Configuration Management Best Practices
The Build Master: Microsofts Software Configuration Management Best Practices
ISBN: 0321332059
EAN: 2147483647
Year: 2006
Pages: 186

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net