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 |
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++.
[!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.
[!INCLUDE include]
https://github.com/adventworks/cpp-sample
[!INCLUDE include]
[!INCLUDE include]
[!INCLUDE include]
- Create a new build definition.
Navigate to the Files tab of the Code hub, and then click Set up build.
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.
- 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.
- 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.
- 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.
- Click the Copy Files task. Specify the following arguments:
- Contents:
**\$(BuildConfiguration)\**\?(*.exe|*.dll|*.pdb)
- Click the Variables tab and modify these variables:
-
BuildConfiguration
=debug, release
-
BuildPlatform
=x86, x64
-
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.
-
Click the Options tab and then:
-
Select Multi-configuration.
-
Specify Multipliers:
BuildConfiguration, BuildPlatform
-
Select Parallel if you have multiple build agents and want to build your configuration/platform pairings in parallel.
-
Click Save & queue to kick off your first build. On the Save build definition and queue dialog box, click Save & queue.
-
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
[!INCLUDE include]