How to declare top rake prerequisites from within a namespace

Here’s the problem

task :mytask do
  # ...
end

namespace :myscope do
  task :mytask => :mytask
end

This will end up with loop dependency error, so how we can call a top level task with the same name of one from our current scope?

The solution is not documented, i found it directly in the rake’s library code.

task :mytask do
  # ...
end

namespace :myscope do
  task :mytask => "rake:mytask"
end
Published in: on May 28, 2008 at 12:48 pm Leave a Comment

The URI to TrackBack this entry is: http://elia.wordpress.com/2008/05/28/how-to-declare-top-rake-prerequisites-from-within-a-namespace/trackback/

RSS feed for comments on this post.

Leave a Comment