如何:使用 TeamCity 引用外部 SLN 文件 [英] HowTo: Reference external SLN files with TeamCity

查看:37
本文介绍了如何:使用 TeamCity 引用外部 SLN 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 TeamCity 的新手,我们有许多受源代码控制的常见项目,然后直接在相关项目中引用,即:

I'm new to TeamCity and we have a number of common projects under source control that are then referenced directly within relevant projects i.e.:

Common
  branches
  tags
  trunk
    CommonProject
      CommonProject.csproj
    Common.sln
ProjectX
  branches
  tags
  trunk
    ProjectX.sln

因此,ProjectX.sln"中对CommonProject.csproj"的引用类似于....\Common\trunk\CommonProject\CommonProject.csproj,这在我们的开发环境中很好,但是当谈到 TeamCity,它说它找不到路径....\Common\trunk\CommonProject\CommonProject.csproj"

As a result, the reference to "CommonProject.csproj" in "ProjectX.sln" is something along the lines of ....\Common\trunk\CommonProject\CommonProject.csproj which is fine within our development enviroments but when it comes to TeamCity it falls over saying it can't find the path "....\Common\trunk\CommonProject\CommonProject.csproj"

解决此问题的最佳方法是什么?我已经尝试将 CommonProject 添加到 TeamCity 作为依赖项,但它似乎仍然不想打球...

What's the best way around this problem? I've tried adding CommonProject to TeamCity as a dependancy but it still doesn't seem to want to play ball...

谢谢

蒂姆

推荐答案

我们通过在 Subversion 中使用 Externals 来解决这个问题,它允许您从不同的(部分)存储库中提取内容.

We address this by using Externals in Subversion which allows you to pull in stuff from a different (bit of the) repository.

然后,当我们构建解决方案时,我们将那些常见项目与项目特定解决方案组合到相同的文件夹中 - 即当我们检查内容时:

Then, when we're building the solutions, we have those common projects grouped into the same folders with project specific solution - i.e. when we check stuff out we have:

Solution1
   +---Project1
   +---Project2
   +---Project3
   +---Common1
   +---Common2

然后,分开:

Solution2
   +---ProjectA
   +---ProjectB
   +---ProjectC
   +---Common1
   +---Common2

因为我们以这种方式设置了外部和目录/文件夹结构,所以理论上您应该能够检出(或导出)一个解决方案"到一个空目录并让它从头开始成功构建(取决于安装所有必要的工具),因此 TeamCity(或任何您的持续集成服务器)也应该能够从头开始构建它.事实上,甚至在我们开始使用 TeamCity 之前,我就将此作为政策,但一旦您开始进行持续集成,价值就会更加清晰.

Because we have the externals and the directory/folder structure set up this way you should, in theory, be able to checkout (or export) a "solution" to an empty directory and have it build successfully from scratch (subject to all the necessary tools being installed) and therefore TeamCity (or whatever your continuous integration server is) should be able to also be build it from scratch. In fact even before we stared using TeamCity I had this as policy but the value is clearer once you start doing continuous integration.

Subversion 红皮书的适当部分在这里:外部定义

The appropriate bit of the Subversion Red Book is here: Externals Definitions

这篇关于如何:使用 TeamCity 引用外部 SLN 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆