Skip to content

Latest commit

 

History

History
119 lines (67 loc) · 4.39 KB

File metadata and controls

119 lines (67 loc) · 4.39 KB
title description ms.prod ms.technology ms.assetid ms.manager ms.author author ms.date ms.topic monikerRange
Build your Visual C++ app | VSTS or Team Foundation Server
Learn how you can use the continuous integration (CI) process in VSTS or TFS to automatically build your Visual C++ app.
devops
devops-cicd
49886DF3-3689-48B3-8F1C-CA99DAFD1E49
douge
alewis
andyjlewis
02/16/2018
quickstart
>= tfs-2017

Build your Visual C++ app

VSTS | TFS 2018 | TFS 2017.2

Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) provide a highly customizable continuous integration (CI) process to automatically build your C/C++ application whenever your team pushes or checks in code. In this quickstart you learn how to define your CI process for a C++ application compiled with Visual C++.

Prerequisites

[!INCLUDE include]

  • While the simplest way to try this quickstart is to use a VSTS account, you can also use a TFS server instead of a VSTS account. Make sure that you have configured a build agent for your team project, and that you have a version of Visual Studio matching your development machine installed on the agent machine.

Get sample app code

[!INCLUDE include]

https://github.com/adventworks/cpp-sample

[!INCLUDE include]

[!INCLUDE include]


Set up continuous integration

[!INCLUDE include]

  1. Create a new build definition.

Navigate to the Files tab of the Code hub, and then click Set up build.

Screenshot showing button to set up build for a repository

You are taken to the Build and Release hub and asked to Select a template for the new build definition.

Navigate to the Builds tab of the Build and Release hub in VSTS or TFS, and then click + New. You are asked to Select a template for the new build definition.


  1. In the right panel, select .NET Desktop, and then click Apply. This template is useful in building most of the Visual Studio solutions including those that contain classic C++ projects.

You now see all the tasks that were automatically added to the build definition by the template. These are the tasks that will automatically run every time you push code changes.

  1. For the Agent queue:
  • VSTS: Select Hosted VS2017. This uses a VSTS pool of agents that have the software needed to build your app.

  • TFS: Select a queue that includes a Windows build agent.

  1. Click Get sources and then:

Observe that the new build definition is automatically linked to your repository.

Select your version control repository. You'll need to authorize access to your repo.


  1. Click the Copy Files task. Specify the following arguments:
  • Contents: **\$(BuildConfiguration)\**\?(*.exe|*.dll|*.pdb)
  1. Click the Variables tab and modify these variables:
  • BuildConfiguration = debug, release

  • BuildPlatform = x86, x64

  1. Click the Triggers tab and enable the Continuous Integration trigger. This will ensure that the build process is automatically triggered every time you commit a change to your repository.

  2. Click the Options tab and then:

  • Select Multi-configuration.

  • Specify Multipliers: BuildConfiguration, BuildPlatform

  1. Select Parallel if you have multiple build agents and want to build your configuration/platform pairings in parallel.

  2. Click Save & queue to kick off your first build. On the Save build definition and queue dialog box, click Save & queue.

  3. A new build is started. You'll see a link to the new build on the top of the page. Click the link to watch the new build as it happens.

//: # (TODO:> To learn more about GitHub CI builds, see Define CI build process for your Git repo

View the build summary

[!INCLUDE include]