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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 5/1/07, Jeff Jolma <jjolma-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello. > > Can someone explain the best way to chain together Rakefiles? > 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. >def rake(*args) ruby "-S", "rake", *args end namespace :projectA do task :test do Dir.chdir("projectA") { rake "test" } end end ---- rake projectA:test Cheers, /Nick --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That works great. Thanks. Jeff On May 2, 7:24 am, "Nick Sieger" <nicksie...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/1/07, Jeff Jolma <jjo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello. > > > Can someone explain the best way to chain together Rakefiles? > > 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. > > def rake(*args) > ruby "-S", "rake", *args > end > > namespace :projectA do > task :test do > Dir.chdir("projectA") { rake "test" } > end > end > > ---- > > rake projectA:test > > Cheers, > /Nick--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---