You are previewing Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build.
O'Reilly logo
Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build

Book Description

As software complexity increases, proper build practices become ever more important. This essential reference drills inside MSBuild and shows how to maximize your control over the build and deployment process. Learn how to customize and extend build processes with MSBuild and scale them to the team, product, or enterprise level with Team Foundation Build. Discover how to: Create and modify MSBuild files outside the Visual Studio IDE Use XML-based syntax to declare dynamic properties and items Apply built-in tasks or write your own Customize the build process adding code generation, unit testing, or code analysis Use batching and incremental builds to reduce build times Invoke external tools in scripts and create reusable files Start and stop services Set assembly versions and extend the clean process Configure, customize, and extend Team Build and automate build from end to end.

Table of Contents

  1. Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. Foreword
    3. Acknowledgements
      1. Sayed Ibrahim Hashimi
      2. William Bartholomew
    4. Introduction
      1. Who Is This Book For?
      2. Organization of This Book
      3. System Requirements
      4. Technology Updates
        1. The Companion Web Site
        2. Support for This Book
    5. I. Overview
      1. 1. MSBuild Quick Start
        1. Project File Details
        2. Properties and Targets
        3. Items
        4. Item Metadata
        5. Simple Conditions
        6. Default/Initial Targets
        7. MSBuild.exe Command Line Usage
        8. Extending the Build Process
      2. 2. MSBuild Deep Dive, Part 1
        1. Properties
        2. Environment Variables
          1. Reserved Properties
          2. Command Line Properties
          3. Dynamic Properties
        3. Items
        4. Copy Task
          1. Well-Known Item Metadata
          2. Custom Metadata
          3. Item Transformations
            1. Demo01
            2. Demo02
            3. Demo03
            4. Demo04
      3. 3. MSBuild Deep Dive, Part 2
        1. Dynamic Properties and Items
          1. Dynamic Properties and Items: MSBuild 3.5
            1. Removing Items
          2. Dynamic Properties and Items: MSBuild 2.0
        2. Property and Item Evaluation
        3. Importing Files
        4. Extending the Build Process
    6. II. Customizing MSBuild
      1. 4. Custom Tasks
        1. Custom Task Requirements
        2. Creating Your First Task
        3. Task Input/Output
        4. Supported Task Input and Output Types
        5. Using Arrays with Task Inputs and Outputs
        6. Extending ToolTask
          1. ToolTask Methods
          2. ToolTask Properties
        7. Debugging Tasks
      2. 5. Custom Loggers
        1. Overview
        2. Console Logger
        3. File Logger
        4. ILogger Interface
        5. Creating Custom Loggers
        6. Extending the Logger Abstract Class
        7. Extending Existing Loggers
        8. FileLoggerBase and XmlLogger
        9. Debugging Loggers
    7. III. Advanced MSBuild Topics
      1. 6. Batching and Incremental Builds
        1. Batching Overview
        2. Task Batching
        3. Target Batching
        4. Combining Task and Target Batching
        5. Multi-batching
        6. Using Batching to Build Multiple Configurations
        7. Batching Using Multiple Expressions
        8. Batching Using Shared Metadata
        9. Incremental Building
          1. Partially Building Targets
      2. 7. External Tools
        1. Exec Task
        2. MSBuild Task
        3. MSBuild and Visual Studio Known Error Message Formats
        4. Creating Reusable Build Elements
        5. NUnit
        6. FxCop
    8. IV. MSBuild Cookbook
      1. 8. Practical Applications, Part 1
        1. Setting the Assembly Version
        2. Building Multiple Projects
        3. Attaching Multiple File Loggers
          1. Creating a Logger Macro
        4. Custom Before/After Build Steps in the Build Lab
        5. Handling Errors
        6. Replacing Values in Config Files
        7. Extending the Clean
      2. 9. Practical Applications, Part 2
        1. Starting and Stopping Services
        2. Web Deployment Project Overview
        3. Zipping Output Files, Then Uploading to an Ftp Site
        4. Compressing JavaScript Files
        5. Encrypting web.config
        6. Building Dependent Projects
        7. Extending the Clean Process
        8. Deployment Using Web Deployment Projects
    9. V. Team Foundation Build
      1. 10. Team Build Quick Start
        1. Introduction to Team Build
          1. Team Build Features
          2. High-Level Architecture
        2. Preparing for Team Build
          1. Build Agents
          2. What Makes a Good Build Agent?
          3. Setting Up a Build Agent
            1. Installing Prerequisites
            2. Installing Team Build
            3. Adding the Build Agent to Team Projects
          4. Drop Folder
        3. Creating a Build Definition
          1. General
          2. Workspace
          3. Project File
            1. Creating a New Project File
          4. Retention Policy
          5. Build Defaults
          6. Trigger
            1. Manual
            2. Continuous Integration
            3. Scheduled
        4. Working with Build Queues and History
          1. Visual Studio Team System
            1. Queuing a Build
            2. Build Explorer
            3. Cancelling, Stopping, Postponing, and Reprioritizing Builds
            4. Viewing Build Details
            5. Changing Build Qualities
            6. Retaining Builds
            7. Deleting Builds
          2. From the Command Line
            1. Queuing a Build
            2. Stopping a Build
            3. Deleting a Build
          3. Performing Desktop Builds
        5. Team Build Security
          1. Service Accounts
          2. Permissions
      2. 11. Team Build Deep Dive
        1. Default Build Processes
          1. End-to-End Build Process
          2. Desktop Build Process
            1. Canonicalize Paths
        2. Customizing the Build Process
          1. Setting Properties and Populating Item Groups
          2. Overriding Extensibility Targets
          3. Customizing End-to-End Build Initialization
            1. CheckSettingsForEndToEndIteration
            2. InitializeBuildProperties
            3. BeforeEndToEndIteration and AfterEndToEndIteration
            4. BuildNumberOverrideTarget
            5. InitializeEndToEndIteration
            6. InitializeWorkspace
          4. Customizing Clean
          5. Customizing Get
            1. Modifying Source-Code Destination
            2. Building Specific Versions
            3. Performing Incremental Gets
            4. Populating Get Output Item Groups
          6. Customizing Label
            1. Customizing Label Details
            2. Customizing What Is Labeled
          7. Customizing Compilation
            1. Defining Solutions to Build
            2. Defining Solutions to Publish
            3. Defining Configurations to Build
            4. Compiling Solutions
            5. Controlling Build Output and Publish Directories
            6. Performing Incremental Builds
          8. Customizing Getting Changesets and Updating Work Items
          9. Customizing Testing
          10. Customizing Generating Documentation and Packaging Binaries
          11. Customizing Drop
          12. Customizing Build Failures
            1. Updating Work Items on Build Failure
            2. Creating Build Failure Work Item
            3. Stopping Build on First Failure
        3. Configuring the Team Build Service
          1. Changing Communications Ports
          2. Requiring SSL
          3. Configuring Communications from Build Agent to Application Tier
          4. Configuring Client Authentication
          5. Running Interactively
          6. Enabling Parallel Builds
          7. Configuring Build Definition Download
          8. Enabling Building on FAT Partitions
          9. Enabling Per Project Log Files
          10. Enabling Tracing
        4. Team Build API
          1. Creating a Project
          2. Connecting to Team Foundation Server
          3. Connecting to Team Build
          4. Working with Build Agents
            1. Querying Build Agents
            2. Adding a Build Agent
          5. Working with Build Definitions
            1. Querying Build Definitions
            2. Creating a Build Definition
          6. Working with Builds
            1. Queuing a Build
            2. Querying Build Queues
            3. Querying Build History
        5. Upgrading from Team Build 2005
          1. Reviewing Applied Defaults
          2. Reviewing Customizations and Extensions
          3. Supporting 2005 and 2008 Clients
            1. Running 2005 (8.0) Tests in Team Build 2008
            2. Detecting If Running in Team Build 2008
            3. Upgrade Checklist
      3. 12. Team Build Cookbook
        1. Documentation
          1. Generating API Documentation Using Sandcastle
        2. Infrastructure
          1. Load Balancing Builds between Build Agents
          2. Configuring Team Build to Use TFS Proxy Server
          3. Running Processes on Remote Machines
          4. Sharing Customizations between Build Definitions
            1. Refactoring Your Customizations
            2. Configuring Your Customizations
            3. Supporting TFSBuild.proj and Imported Customizations
            4. Choosing a Location for Your Customizations
          5. Executing Multiple Targets from an Extensibility Target
        3. Logging
          1. Adding Build Steps to the Build Details Window
        4. Packaging and Deployment
          1. Deploying Source Code with the Binaries
          2. Zipping the Binaries and Source Code
          3. Adding Symbols to Symbol Server
        5. Versioning
          1. Assembly Versioning
    10. A. New Features in MSBuild 3.5
      1. Properties and Items Declared Inside Targets
      2. Multiprocessor Support
      3. Multitargeting
      4. ItemDefinitionGroup
      5. Registry Syntax
      6. New Reserved Properties
      7. MSBuild Task Changes
      8. Exec Task Changes
    11. B. Common Properties and Items
      1. Common Properties
      2. Common Items
        1. Reference
        2. COMReference
        3. COMFileReference
        4. NativeReference
        5. ProjectReference
        6. Compile
        7. EmbeddedResource
        8. Content
        9. None
    12. C. New Features in Visual Studio Team System 2010 Team Build
      1. Windows Workflow Foundation
        1. Build Process Designer
        2. Build Activities
      2. Build Templates
      3. Build Controllers
      4. Gated Check-in
      5. Private Builds
      6. Improved Control over Build Deletion
      7. Integration with Symbol and Source Server, WiX, Visual Studio Team System for Database Professionals, and MSTest
      8. Usability Improvements to Build Details
      9. Where Does This Leave MSBuild?
    13. About the Authors
      1. Sayed Ibrahim Hashimi
      2. William Bartholomew
    14. Index
    15. SPECIAL OFFER: Upgrade this ebook with O’Reilly