views:

33

answers:

1

I have a library I wrote with a structure like this:

SolutionA\
--Source\
  --Core\
  --Tests\
--Tools\
  --TestFramework\
  --MockTool\
SolutionA.sln

I want to include this as a submodule for SolutionB. If I use this entire structure as a submodule, it would get a bunch of stuff that SolutionB doesn't care about; it doesn't care about SolutionA.sln; it doesn't care about Tests\; it doesn't care about Tools\. Really, SolutionB only cares about Core\.

It looks like I need a separate repository for Core\. So is it usual practice to have two repositories for .NET solutions whose source is used by other solutions? One for only the (non-test) code itself (plus needed libraries), and one for the test tools and solution file?

+1  A: 

Solutions are simply containers for one or more projects; which may fall under the same "solution" folder or somewhere externally.

If you have a project, in this case "Core" then you can reference that project source directly from one or more solutions. In this case, SolutionA and SolutionB.

The extraneous stuff like Tests\, TestFramework\, MockTool\, etc, unless required by Core, don't have to be included in your other solution.

Make sense?

Chris Lively
I see what you're saying, but I need my build server to be able to pull what it needs to build SolutionB all by itself. I could manually set up the .sln structure on the build server, and have it pull in repositories into that folder, but I'd rather have a clone-n-go strategy here. (Build server --> git clone uri/to/SolutionB.git --> go).
Sam Pearson
(With perhaps a submodule init + update, which TeamCity's git plugin can be configured to do)
Sam Pearson
On second thought, going forward I'll probably end up using this solution (with a couple modifications). There's simply too many shared resources among the repositories to copy into each one, and I'm writing so many bespoke applications there's going to be many more repositories.
Sam Pearson