HowTo: Reference external SLN files with TeamCity

≯℡__Kan透↙ 提交于 2020-01-06 16:54:23

问题


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

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"

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...

Thanks

Tim


回答1:


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

Then, separately:

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

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.

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



来源:https://stackoverflow.com/questions/1633526/howto-reference-external-sln-files-with-teamcity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!