So, in more recent versions of Rake (0.8.6 or thereabouts), you can use arguments to tasks, like this:
task :my_task, [:whick, :whack] => [:depend_on] do |task, args|
args.with_defaults(:whack => 42)
end
(Actually, there's about a dozen (well, four) different formats for task definition, but there's 20 reasonable formats that won't work, and I've found that the :task, [:args] => [:deps] format is the best one to remember.)
Now, if a dependency also has arguments, and they're a subset of the primary tasks arguments, then they'll be assigned, regardless of their relative order.
task :depend_on, [:whack] do; end
:depend_on will get :whack assigned from the arguments assigned by :my_task.
No comments:
Post a Comment