This extension provides the tasks 'run-vcpkg' and 'run-cmake' to build C++ code on Azure DevOps pipelines. Take a look at examples in the README.md file.
The 'run-vcpkg' task
It uses Git to fetch vcpkg, it builds it, then launches vcpkg to build the specified ports.
Caching vcpkg's artifacts
The CacheBeta task could be used to cache vcpkg's artifacts to minimize build time. Use the task to cache the entire
The key provided to the CacheBeta task must uniquely identify the following:
The following sample key should grant all of the above:
Note: the key must be a one liner, it could be divided in segments with the pipe character, each non-path segment must be enclosed with double quotes. [source]
Further improvements could be made to the run-vcpkg task in order to support the automatic retrieval of the commit id of the vcpkg repository when the latter is a submodule of the build repository. Contributions are welcome!
The 'run-cmake' task
The 'run-cmake' task works with CMakeLists.txt and CMakeSettings.json.
It can leverage the previous execution of the 'run-vcpkg' task by using the
Questions and Answers
Why not one single task?
Because you could use vcpkg only without CMake. Or you could use CMake without vcpkg.
Would creating an ad-hoc bash/powershell script be easier?
Absolutely! Anyone can use this task as an inspiration for writing their own scripts to suite specific needs. The purpose of the tasks is to streamline and to simplify the usage of vcpkg and CMake on build servers.
Please get the source and contribute
The software is provided as is, there is no warranty of any kind. All users are encouraged to get the source code and improve the tasks with fixes and new features.
The 'Run CMake" flowchart
The flowchart has two entry points as it could be used with a CMakeLists.txt or with a CMakeSettings.json file.
The 'Run vcpkg' flowchart