I am facing problems structuring projects and libraries.
In the company I am working for I often see, that things would be more maintainable and less error prone, if we could extract common code and build libraries with that code.
A simple example may be the usage of a custom logging library instead of copying code from other projects or, even worse, writing everything again from scratch.
So wanting to expose things into libraries there comes up the question how to do that? My idea is to put every lib(or related set of libraries) into its own repository. But this would mean, that to build the project, you definetly need to check out at least two repositories. Because I have been workong on a project with dependencies to a lot of other repositories I became quite careful with creating dependencies to other projects.
So my question is: is there another nice solution for this? What do you guys do?
There are more than 150 repositories, which are not all related of course. Most of the projects have their own repository. To provide a scenario, lets assume the following:
- Application A
- Application B (already references 30 other in-house repositories)
Both applications need to use LibXYZ.
Versioning depends on the project. The older projects just took the revision number from SVN. We are now moving to versioning with fix numbers like 1.2 or 1.2.5, so let's assume this as versioning approach. Every release is tagged in SVN.
We are using Qt targetting mainly Windows. But I appreaciate a cross-plattform approach very much.
What prevents me from just creating a repository for common code?
The problem I see is that it adds a lot of complexity to a project. To be able to compile and run an application I need to:
- check out multiple repositories
- compile all depencies
- copy all compiled DLL's into the application's build directory
All this again has to be documented and maybe also to be included in the build scrips. Moreover this forces the other team members to have the exact same setup as I do.
I am not saying that this is impossible, I am just searching for a better approach.