Multiple projects – multiple repositories

Do you have one project you want to share between multiple solutions? Something like a big set of helpers or a framework you need here and there? There are multiple ways ones have achieved this goal. Let me describe how I’ve done this.
We work with Visual Studio as our main development environment and Subversion as our source control system. What we needed was a systematic approach where we share our framework across all of our projects. We are actively developing our framework so simple dll reference is not an option. Our rules according to framework development make it fairly save to share the same code across multiple projects and to develop at the same time.
We decided that the framework should by placed in separate SVN repository and a separate Visual Studio project. But we wanted the framework and the project being pullable from source control as a whole. Firstly because we are (I’m!) lazy and I don’t want to remember that I have to check out the framework and than the project separately. Secondly we have a living Continuous Integration system running on CruiseControl.NET and it should by able to detect the changes and build to project in one shot.
Our way is to add the framework as an existing project from separate solutions…
Project structure
and to connect the main SVN project repository with framework repository as a svn:external.
Folder structure
Step by step solution:
1. Create “Framework” Project in Visual Studio
2. Create a SVN repository for this project (check everything you need in)
3. Create new solution in Visual Studio that will hold your “Project”
4. Create a SVN repository for this project
5. Create new folder on hard drive inside the “Project” folder
6. Check out the framework from repository into newly created folder
7. In Visual Studio add the framework to you solution as a existing project.
Adding exisitng project
8. Link the Framework repository with the Project repository (using svn propset or with TortoiseSVN like this)
svn:externals
You are done!
Now if you check out the “Project” you will get the “Framework” automatically. Unfortunately if you will make changes into “Framework” you will not by able to checkc everything in. You will have to separately check the “Framework” changes and “Project” changes. But if you are using Tortoise SVN you will by warned.
TortoiseSvn externals warning
Is is cool or not!?

Leave a Reply

Your email address will not be published. Required fields are marked *