0

We have a large code base with various labels which need autobuilding. We are using TFS 2012 Express and VS 2010

Our code is build by a batch file so I have created a dummy solution which the autobuild builds, the build instructions for this solution just run the batch file.

I had the idea of using different configurations in this solution to build different labels.

So, as well as debug and release configurations I added one called LABEL which calls a different batch file and added a new automatic build in TFS which calls this solution with the 'label' configuration in the box Required - Configurations to build.

However, when I try to run it it fails claiming that the 'label' configuration does not exist.

Does anyone know how to do this?

Extra: It seems to work if I use the Release configuration to call one batch file and the Debug one to call another but it still cannot find user created configurations?

4

1 回答 1

-1

如果假设“自动构建”意味着“通过 TFS 构建定义构建”。

如果“标签”是指源代码控制标签,那么在对构建进行排队时,可以将其“获取版本”参数设置为标签 - 例如,用于标签MyLabel使用LMyLabel

如果“标签”是指批处理文件构建内部的一些定义,那么您可以通过 MSBuild 属性传递它:通过添加"/p:label=mylabel"到“MSBuild 参数”在构建定义中定义它。然后,在解决方案调用您的批处理的地方,您可以使用$(label)它从构建定义中获取值。

此外,您可以修改构建模板以直接调用批处理文件,并在构建定义中设置一个参数,然后模板将其传递给批处理文件,而不是这个 hacky .sln。

于 2013-04-12T10:17:58.740 回答