A while ago I asked: How do you manage your open source software?. It seems like Bill Pierce had the same question, so I thought I should get to writing my follow up.
I also asked this same question on the alt.net mailing list (whole thread is here).
A lot of folks suggest not updating once you have picked some library to use. That is a fine approach in some cases, but in my opinion things like Castle and NHibernate are never done and I want to be able to update and take advantage of new features.
So, how do I handle this today?
Import the open source project subversion repository into a git repository.
Build the project and copy its outputs to MyProject/Lib/OpenSourceProjectName using a rakefile I wrote.
Commit the changes to MyProject noting the sha1 (from git) and the svn revision of the open source project.
Create a git tag in the open source project git repository that ties it to the branch in my other project.
What does this look like in practice?
git svn fetch #gets changes from castle svn
rake build:castle libcopy:castle_to_myproject
git add lib/castle
git commit -m "Updated castle libs to sha xxxxxxxxxxxxxx svn revision 4000"
git tag -f -a myproject-trunk
So far I have been pretty happy with this approach. It could definitely be a little more automated, but it is doing the job.
The link between the open source code and myproject is maybe a bit too fragile. I think I can do better using either git submodules or braid.
I've been experimenting with braid on my rails projects, I'm not sure yet if it will make sense to use it with for this though.
If you are interested here's the rakefile I use:
libs_in_use.each do |lib|
puts "Check for " + lib
lib_file = lib_build_dir + "/" + lib.pathmap("%f")
puts "Found " + lib_file
cp lib_file, File.expand_path(lib.pathmap("%p"))
puts "lib not found:" + lib_file
namespace :build do
CASTLE_BUILD_DIR = 'q:/castle/build/net-3.5/debug'
task :castle do |t|
puts "Building Castle...."
puts sh("c:\\tools\\nant-0.86-beta1\\bin\\nant.exe -t:net-3.5 -D:common.testrunner.enabled=false -D:mbunit-console=c:\\progra~1\\mbunit\\mbunit.cons.exe")
puts "Build Finished"
task :rhino do |t|
puts "Building Rhino-tools"
puts `msbuild.exe BuildAll.build`
puts "Done building rhino"
task :update_rhino_from_castle do
rhino_castle_libs = FileList['./rhino-tools/SharedLibs/Castle/*']
namespace :libcopy do
task :castle_to_api do
api_castle_libs = FileList['./OmniaAPI/DependentFiles/Castle/*']
task :castle_to_mrrest do
dest_castle_libs = FileList['./MRRestSupport/lib/*']
task :castle_to_myproject do
dest_castle_libs = FileList['./myproject/DependentFiles/Castle/*']
task :castle_to_codegenerator do
dest_castle_libs = FileList['./Castle.MonoRail.CodeGenerator/Libraries/*.dll']