chaining together Rakefiles

Hello.

Can someone explain the best way to chain together Rakefiles?

I am working on a project with the following layout:

# comon libraries depot/common

# one rails appserver depot/projectA

# another rails appserver depot/projectB

All of these projects (common, projectA, projectB) have their own Rakefiles that allow the standard test targets (e.g. test, test:units). I would like to have a Rakefile in the depot directory be able to call into one or more of the projects' Rakefiles. For example, running "rake test" in depot would be able to run "rake test" in one or more of the subprojects. I'd also like to do something similar for code coverage tasks.

What is the best way to do this? Executing the projects' Rakefiles from the master Rakefile via something like this doesn't work since "rake test" needs to be run from the project's base directory:

ruby("projectA/Rakefile test")

And even if that did work, it seems like there would be a cleaner way.

I appreciate any thoughts.

Jeff

def rake(*args)   ruby "-S", "rake", *args end

namespace :projectA do   task :test do     Dir.chdir("projectA") { rake "test" }   end end

That works great. Thanks.

Jeff