I have code that represents the interface for a library that is used by a variety of internal clients. How should that interface code be exposed to these internal clients that live in different source control repositories?

The interface should be relatively stable, but is in development (as is most of the internal clients) so keeping changes communicated is important, as is keeping breaking changes to a minimum. Normally, I would just directly reference them in the other modules but the separated nature makes that troublesome.

  • Git allow a folder to be managed by a different, independent instance of git, using git submodule. You might be looking for something similar in your version control. – Lie Ryan Jul 31 '12 at 0:13

There are multiple ways and it really depends on your library/setup.

Typically you can reference other repositories, e.g. with submodules for git or for example externals and svn. This is the simplest and probably also hackiest solution as you are directly referencing to the library and your clients would have to build them as well.

You can provide binary packages for your library, e.g. gems/eggs/debs/rpms/… and just reference it from your build process or assume it is present at runtime. This is in my opinion a quite clean approach.

Let your buildsystem handle the dependencies, e.g. rely on maven or use other tools like bundler/carton/openembedded or other similar tools for your language. They can automatically download and build your dependencies.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.