Inside-the-Microsoft-Build-Engine.pdf

(2613 KB) Pobierz
Foreword by Richard Hundhausen
MVP for Visual Studio ® Team System, Microsoft Regional Director, Author
Inside the Microsoft ® Build En gine:
Using MSBuild and
Team Foundation
Build
Sayed Ibrahim Hashimi
William Bartholomew
891367403.001.png
PUBLISHED BY
Microsoft Press
A Division of Microsoft Corporation
One Microsoft Way
Redmond, Washington 98052-6399
Copyright © 2009 by Sayed Hashimi and William Bartholomew
All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means
without the written permission of the publisher.
Library of Congress Control Number: 2008940523
Printed and bound in the United States of America.
1 2 3 4 5 6 7 8 9 QWT 4 3 2 1 0 9
Distributed in Canada by H.B. Fenn and Company Ltd.
A CIP catalogue record for this book is available from the British Library.
Microsoft Press books are available through booksellers and distributors worldwide. For further information about
international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at
fax (425) 936-7329. Visit our Web site at www.microsoft.com/mspress. Send comments to mspinput@microsoft.com.
Microsoft, Microsoft Press, Excel, IntelliSense, MSDN, SQL Server, Visual Basic, Visual C#, Visual C++, Visual Studio,
Win32, Windows, Windows NT, Windows Server, Windows Vista, and WinFX are either registered trademarks or trademarks
of the Microsoft group of companies. Other product and company names mentioned herein may be the trademarks of their
respective owners.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events
depicted herein are fictitious. No association with any real company, organization, product, domain name, e-mail address,
logo, person, place, or event is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the authors, Microsoft Corporation, nor its resellers, or distributors will
be held liable for any damages caused or alleged to be caused either directly or indirectly by this book.
Acquisitions Editor: Ben Ryan
Developmental Editor: Devon Musgrave
Project Editor: Rosemary Caperton
Editorial Production: S4Carlisle Publishing Services
Technical Reviewer: Brian Kretzler and Martin Danner;
Technical Review services provided by Content Master, a member of CM Group, Ltd.
Cover: Tom Draper Design
Body Part No. X15-25186
I would like to dedicate this book to my parents, Sayed A. Hashimi
and Sohayla Hashimi. They have sacrifi ced more than I could
imagine in order to give us (their 4 sons) the opportunity to succeed.
Without their sacrifi ces, guidance, and inspiration I am sure that
I would not have written my second book; in fact I have no idea
where I would be now. Thank You.
—Sayed Hashimi
I’d like to dedicate the book to my family - Rosanna, Roy, Carey,
and Kate and to my partner Vanessa.
—William Bartholomew
Contents at a Glance
Part I Overview
1
MSBuild Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2
MSBuild Deep Dive, Part 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3
MSBuild Deep Dive, Part 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Part II Customizing MSBuild
4
Custom Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
5
Custom Loggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Part III Advanced MSBuild Topics
6
Batching and Incremental Builds . . . . . . . . . . . . . . . . . . . . . . . . . 139
7
External Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Part IV MSBuild Cookbook
8
Practical Applications, Part 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
9
Practical Applications, Part 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Part V Team Foundation Build
10
Team Build Quick Start. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
11
Team Build Deep Dive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
12
Team Build Cookbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
Appendixes
A
New Features in MSBuild 3.5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
B
Common Properties and Items. . . . . . . . . . . . . . . . . . . . . . . . . . . 363
C
New Features in Visual Studio Team System
2010 Team Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
v
891367403.002.png
Zgłoś jeśli naruszono regulamin