tags:

views:

151

answers:

1

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

A: 

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

Murph
Thanks Murph, I looked at using Externals before but felt that it would confuse matters, it looks like I'll need to re-investigate it.Am I right in thinking that you'd effectively duplicate the Common projects? I assume that the changes made to Common1 in Solution1 will be reflected in Solution2 after a commit/update?
Tim
Yep that looks like it sorts it thanks
Tim
@Tim - its kind of a matter of perspective, but in terms of the data you have on the HDD of your dev box yes you will have duplicates of the common projects and yes you'd propogate changes to those projects by commit/update. I also agreed that its adding complexity (confusing matters) - you introduce new concerns about the effect of changes to common projects (which of course running CI helps to address) but you can, where appropriate, tie external references to specific revisions.
Murph