Dela via


Create a Basic Build Definition

After you put a build system in place (as described in Configure Your Build System), you are almost ready to start using Team Foundation Build to compile your code, run your tests, and perform many other important functions. The next step is to create a build definition. A build definition contains your instructions about which code projects to compile, which additional operations to perform, and how to perform them.

Required Permissions

To perform this procedure, you must have the Edit Build Definition permission set to Allow. For more information, see Team Foundation Server Permissions.

To create a build definition

  1. In Team Explorer, click the team project for which you want to create a build definition.

  2. On the Build menu, click New Build Definition.

    The New Build Definition window appears with the General tab displayed.

  3. In the Build definition name box, specify the name to associate with the build definition.

  4. In the Description box, add an appropriate description.

    This description provides additional information to people on your team when they are about to manually queue a build (as described in Queue a Build).

  5. Click the Build Defaults tab.

    The This build copies output files to a drop folder check box should remain selected. Your builds will fail if you clear this check box and use a build template that produces output.

    Tip

    If you do not want output files to be copied to a drop folder and you are basing your build process on DefaultTemplate.xaml, go to the Process tab, and set Copy Outputs to Drop Folder to False.

  6. In the Copy build output to the following drop folder box, type the UNC file path of the folder where you want the build system to put binaries and log files.

    Important

    You must specify a folder that has been prepared for use as a drop folder. For more information, see Set Up Drop Folders.

  7. If more than one build controller appears in the Build controller list, click the build controller that you want the build system to use to process this build definition.

  8. Click the Trigger tab, and specify the event that you want to cause this build definition to be run. For more information, see Specify Build Triggers and Reasons.

  9. Click the Process tab, and specify details about what functions this build performs and how it performs them:

    • To define a build quickly and easily, in the Build process file list, click Default Template. Review and modify the values of the Build process parameters as necessary. For more information such as explanations of the Build process parameters and how to use them, see Define a Build Using the Default Template.

    • If your team must use a build process that is driven by MSBuild, in the Build process file list, click Upgrade Template. Review and modify the values of the Build process parameters as necessary. For more information such as explanations of the Build process parameters and how to use them, see Define a Build Using the Upgrade Template.

    • If your team has defined a custom template that you want to use, click it in the Build process file list. Review and modify the values of the Build process parameters as necessary. For more information, see Create and Work with a Custom Build Process Template.

  10. To make sure that the files that your build process requires are downloaded to the build agent, click the Workspace tab, and adjust the settings as needed. For more information, see Delete a Completed Build.

  11. Click the Retention Policy tab.

    Two sets of retention policies appear in the Specify how builds should be retained list and can be modified to meet your team's needs:

    • The Triggered and Manual group of policies limit what the system keeps from those builds that were queued either manually or by an automatic trigger.

    • The Private group of policies limit what the system keeps from those builds that were queued either manually from source code in a shelveset (as described in Queue a Build).

    To modify a retention policy for Stopped, Failed, Partially Succeeded, or Succeeded completed builds, perform either or both of the following steps:

    • Click the value in the Retention Policy column, and click one of the following options: Keep All, Keep Latest Only, Keep 2 Latest, Keep 5 Latest, Keep 7 Latest, Keep 10 Latest, or Specify Count to Keep.

    • Click the value in the What to Delete column, and click a value. For more information about these values, see Work with Build Workspaces.

  12. When you finish working on the build definition, open the File menu, and click Save <Name of Build Definition>.

    The created build definition appears in the Builds folder in Team Explorer. To view or modify the settings of the build definition, you right-click it, and then click Edit Build Definition.

See Also

Tasks

Delete a Build Definition

Concepts

Define Your Build Process

Change History

Date

History

Reason

August 2011

Added tip about how to disable dropping binaries.

Information enhancement.