如何配置 teamcity 构建代理以使用系统上的包含文件?

How to configure teamcity build agent to use include files on system?

我有一个使用 boost headers/libraries 的项目,我想为其创建团队城市构建代理的构建配置 (TeamCity 10.0.2 / Windows 10 / Visual studio 2015)。 boost headers/libraries 不是项目的一部分(即 boost 不在 git 中)。相反,开发机器上的 boost headers/libraries 是相对于项目文件定位的(例如 $(SolutionDir).......\boost_1_59_0).

使用构建代理构建失败,因为找不到 boost 头文件。为了解决这个问题,我尝试了:

如何配置构建代理,使其知道在哪里可以找到 boost 库?

在您的构建配置中,在 sln 构建之前创建一个 新构建步骤 ,它将 boost headers 复制到适当的文件夹中。使用 Command Line Runnerxcopy 命令来执行此操作。

命令行可以使用源校验目录:

xcopy /Y /E "E:\local_boost_install_folder" "%system.teamcity.build.checkoutDir%\src\boost_1_59_0"

另一种方法是将脚本工作目录设置为 %system.teamcity.build.checkoutDir%\src\ 并创建目录 link:

mklink /D boost_1_59_0 "E:\local_boost_install_folder"