In "Version Control with Subversion", the Vendor Branches section sets up a vendor branch for "libcomplex" and then uses the following command to copy libcomplex into the main development branch:
$ svn copy http://svn.example.com/repos/vendor/libcomplex/1.0 \
http://svn.example.com/repos/calc/libcomplex \
-m "bringing libcomplex-1.0 into the main branch"
However, what if we only require a subset of the functionality (and thus a subset of the files) of libcomplex?
Is it OK to copy only part of libcomplex into the main branch? Or is this likely to cause problems (particularly when it comes to upgrading libcomplex)?
Perhaps the easiest way to approach this is to only commit the files that you need into your repository in the first place. This makes the Subversion side of the problem trivial. If you can write a script that extracts the library subset that you need from the drop that you get from your vendor, then the entire process can be automated away. This is still doable if the extraction has to be done manually, but it's a bit more annoying. Either way, it will most likely turn into a maintenance headache. Third-party libraries typically aren't designed to be split up, so you'll risk having to make manual changes whenever the library makes any structural changes.
A completely different approach is to compile the library (or a subset of it) into a binary file, and then only commit that binary file into your source tree. This is what I do on a project that I work on. We have a separate repository for libraries from vendors. A custom makefile will build svn://vendor_repo/trunk
and generate svn://vendor_repo/trunk/libs
(which are committed along with each new drop), and it is this libs
subfolder that we pull into our main repository using svn:externals
. With this method, our code doesn't know (or care) whether the libs are a subset or the entire library. All they see is a binary file to link against. The extent of the code that we have to manually maintain is the custom makefile that we use to build the vendor library.