The basic concept of "binary publishing" is to have an automated system that publishes build artifacts (binaries, like dlls or object files) back into source control so that they can then be referenced in another (downstream) project. This gives your developers the opportunity to easily share binaries, as opposed to needing to share code. This can be desirable if you are trying to to reduce coupling between internal components, or if your monolithic builds are getting too large to be manageable.
To implement binary publishing, you need a source control system that supports some sort of "symbolic link" syntax, where checking out project X automatically checks out dependency Y, because the "symbolic link" to dependency Y is defined on project X itself. Subversion's externals syntax does the trick (I believe that git's submodules can do the same thing, but I haven't tried it myself).
In addition, you need an automated mechanism for committing to the repository. Effectively, to "publish" build artifacts to a binary repository, we want to make the "HEAD" (to use the subversion term for the current revision of the repository) look exactly like the unversioned directory filled with build artifacts that our build process generated. In subversion, this is trickier than it should be out-of-the-box, because you need to first determine what has been added and deleted, and then apply the requisite "svn" commands to make those changes commit-able (subversion is optimized for the "working copy" scenario, where you interact with a working copy that can track your changes, as opposed to this scenario where our work is done in an unversioned directory, and then we wish to apply the "changes" to the repository in one step). Luckily, the subversion developers have already implemented this functionality for us, via the somewhat hard-to-find svn_load_dirs.pl script. To actually get the script, you need to go directly to subversion's subversion repository, as it is not included with the binary distributions. To get this working properly on Windows, the script required a few modifications, which I will describe in a later post.
By wiring svn_load_dirs.pl into your build process, you can easily have your continuous integration server publish artifacts to a subversion-powered binary repository automatically with every developer commit.
Tuesday, February 9, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment