I\'m new to Rake and using it to build .net projects. What I\'m interested in is having a Summary task that prints out a summary of what has been done. I want this task to alw
You should be able to do this with 'enhance':
Rake::Task["my_task"].enhance do
Rake::Task["my_after_task"].invoke
end
This will cause 'my_after_task' to be invoked after 'my_task'.
If you want to apply this to all tasks, just loop over all the tasks and call enhance for each:
Rake::Task.tasks.each do |t|
t.enhance do
Rake::Task["my_after_task"].invoke
end
end
Full test file:
task :test1 do
puts 'test1'
end
task :test2 do
puts 'test2'
end
Rake::Task.tasks.each do |t|
t.enhance do
puts 'after'
end
end
And the output:
$ rake test1
test1
after
$ rake test2
test2
after