End to end build automation using Team Build - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

End to end build automation using Team Build

Description:

Process (Project/Properties/Items/Targets) Reports. Post 'Orcas' Build Notification Applet ... Properties can be marked Output() Most intrinsic types are supported ... – PowerPoint PPT presentation

Number of Views:209
Avg rating:3.0/5.0
Slides: 31
Provided by: anthony128
Category:
Tags: automation | build | end | team | using

less

Transcript and Presenter's Notes

Title: End to end build automation using Team Build


1
End to end build automation using Team Build
  • William Bartholomew
  • Developer Productivity Specialist, TechnologyOne
  • william_bartholomew_at_technologyonecorp.com

2
Who Am I?
  • Developer Productivity Specialist TechnologyOne,
    Brisbane
  • Technical Reviewer of Code Complete 2nd Edition
    by Steve McConnell
  • Technical Reviewer of .NET Standard Library
    Annotated Reference Volume 2 by Brad and Tamara
    Abrams
  • Member of Microsoft UI Frameworks Advisory
    Council (ASP .NET and Smart Client)
  • Member of Microsoft Visual Studio Orcas TAP
  • MSDN Forum Moderator
  • Standards Australia Systems and Software
    Engineering Committee Member

3
Agenda
  • Introduction to MSBuild
  • MSBuilds Limitations
  • Introduction to Team Build
  • Creating a Build Type
  • Executing a Build
  • Default Process
  • Editing Build Types
  • Build Process Customisation
  • Writing Custom Tasks
  • Resources

4
Introduction to MSBuild
  • Microsoft supported build engine
  • XML-based configuration file
  • IntelliSense available from Visual Studio using
    supplied schema
  • Ships with .NET Framework 2.0, it is NOT part of
    Team Foundation Server
  • Both Visual Studio and Team Foundation Server
    leverage MSBuild
  • Command-line utility - MSBuild.exe
  • API to read, manipulate and execute MSBuild
    projects

5
MSBuilds Limitations
  • There arent any mature GUIs.
  • There arent any debuggers.
  • You can still debug custom tasks using
    System.Diagnostics.Debugger.Break.
  • Limited number of built in tasks compared to
    NAnt and some commercial build tools.
  • Growing collection of open-source tasks.
  • Easy to write your own tasks.

6
Examine a .vbproj File
  • Demo
  • How does this work?
  • Extends Microsoft.VisualBasic.targets
  • Which extends Microsoft.Common.targets

7
MSBuild Concepts
8
MSBuild Concepts
  • Projects
  • The root concept in MSBuild
  • Defines the build process
  • Properties
  • Name/value pairs
  • Items
  • Set of objects (commonly files)
  • Can specify meta-data to be applied to the objects

9
MSBuild Concepts
  • Targets
  • Defines a number of sequential tasks
  • Projects can have initial and/or default targets
  • Tasks
  • Performs an operation
  • Uses properties and items
  • Extensible

10
Introduction to Team Build
  • What is Team Build?
  • Service
  • Queuing/Scheduling/Continuous Integration
  • Process (Project/Properties/Items/Targets)
  • Reports
  • Post Orcas
  • Build Notification Applet
  • http//blogs.msdn.com/jimlamb/archive/2007/05/15/b
    uild-notification-applet.aspx

11
Service
http//geekswithblogs.net/etiennetremblay/archive/
2006/10/04/93213.aspx
12
Process
  • What does Team Build do out-of-the-box?
  • Clean the build area
  • Retrieve latest version of source code
  • Label source code
  • Compile one or more solutions
  • Run code analysis and tests
  • Update work items
  • Deploy binaries to a drop folder
  • Provide centralised logging and reporting

13
Process
  • Extends Microsoft.TeamFoundation.Build.targets
  • Supports customisation
  • Configuration files
  • Customisable properties
  • Customisable targets
  • Supports extensibility
  • Custom tasks
  • Team Foundation API
  • Build eventing

14
Creating a Build Type
  • Demo
  • Creates three files in Source Control
  • TfsBuild.proj
  • TfsBuild.rsp
  • WorkspaceMapping.xml
  • Best Practices
  • Avoid spaces in the name
  • Choose a long-term name

15
Executing a Build
  • Demo
  • Scheduled
  • Continuous Integration
  • From within Visual Studio
  • From the Command-Line (TfsBuild.exe)
  • Also allows you to stop a build and delete builds
  • From the web service

16
Default Build Process
  • Generate build number
  • Clean
  • Get
  • Label
  • Compile
  • Create work items
  • Test
  • Drop

17
Desktop Build Process
  • Compile
  • Test
  • No status report
  • Not part of build history
  • Launched from the command-line
  • MSBuild TfsBuild.proj /pSolutionRoot..\..

18
Editing Build Types
  • Directly edit the files in Source Control
  • Team Build will automatically get the latest
    version for each build
  • Because these are stored in Source Control we can
    reproduce any previous build, but make sure you
    keep your build dependencies in Source Control

19
Editing Build Types
  • Demo
  • Attrice Team Build Sidekick

20
Build Process Customisation
  • Each step in the build process provides
    customisation points
  • BeforeEndToEndIteration, AfterEndToEndIteration
  • BuildNumberOverrideTarget
  • BeforeClean, AfterClean
  • BeforeGet, AfterGet
  • BeforeLabel, AfterLabel
  • BeforeCompile, AfterCompile

21
Build Process Customisation
  • Customisation points continued
  • BeforeTest, AfterTest
  • BeforeDropBuild, AfterDropBuild
  • BeforeOnBuildBroke, AfterOnBuildBroke
  • You can override the other targets, but beware!

22
Build Process Customisation
  • Demo
  • Override build number
  • Get
  • SkipGet
  • ForceGet
  • RecursiveGet
  • Partial get using WorkspaceMapping.xml

23
Build Process Customisation
  • Skip process step variables
  • SkipClean
  • SkipGet
  • SkipLabel
  • SkipInitializeWorkspace
  • SkipPostBuild
  • SkipDropBuild
  • SkipWorkItemCreation

24
Build Process Customisation
  • Location variables
  • WorkspaceName
  • SolutionRoot
  • BinariesRoot
  • TestResultsRoot

25
Build Process Customisation
  • Demo
  • Work Item Creation
  • Change Assigned To

26
Writing Custom Tasks
  • Either implement Microsoft.Build.Framework.ITask
  • Or, inherit Microsoft.Build.Utilities.Task
  • Provide Team System awareness by passing
    (TeamFoundationServerUrl) and (BuildURI) as
    properties
  • Avoid requiring Team System when not necessary

27
Writing Custom Tasks
  • XML attributes are passed through as properties
  • Properties can be marked ltRequired()gt
  • Properties can be marked ltOutput()gt
  • Most intrinsic types are supported
  • Arrays of these types are also supported,
    delimited using in XML
  • Use ltUsingTaskgt to reference your custom task

28
Writing Custom Tasks
  • Demo

29
Resources
  • MSDN Forums
  • http//forums.microsoft.com/forums/default.aspx?Fo
    rumGroupID5
  • OzTFS Mailing List
  • http//www.oztfs.com/
  • SDC Tasks
  • http//www.codeplex.com/sdctasks/
  • MSBuild Tasks
  • http//msbuildtasks.tigris.org/

30
Resources
  • Attrice Team Build Sidekickhttp//www.attrice.inf
    o/cm/tfs/TeamBuildAddin.htm
  • Team System Widgets http//accentient.com/widgets
    .aspx
  • Book Build Master
Write a Comment
User Comments (0)
About PowerShow.com