开发者

How to use Rake to manage multiple directory project?

开发者 https://www.devze.com 2023-02-13 02:36 出处:网络
I have a project that consists of multiple projects, something like: my_project\\ proj_A\\ (code, tests, Rakefile, etc)

I have a project that consists of multiple projects, something like:

my_project\ proj_A\ (code, tests, Rakefile, etc) proj_B\ (code, tests, Rakefile, etc) proj_C\ (code, tests, Rakefile, etc)

I'd like to create a Rakefile under "my_project" that can execute the Rakefile's in the other pr开发者_Go百科ojects. For example to package up the entire app I need to run tasks defined in the Rakefile's in proj_A, proj_B and then proj_C (in that order).

What's the best way to do this? Just have a Rakefile that defines tasks which call out to the other Rakefiles?


Create a rake task that depends on all the other projects.

import 'projdir1/Rakefile'
import 'projdir2/Rakefile'

task :finalproject => [:project1, :project2] do
  # do nothing or maybe some cleanup
end

The tasks :project1 and :project2 would be defined in the external rakefiles being included.

Also look at this page for more complex examples. http://rake.rubyforge.org/files/doc/rakefile_rdoc.html

0

精彩评论

暂无评论...
验证码 换一张
取 消