【发布时间】:2009-11-06 18:43:46
【问题描述】:
我是 Rake 新手,并使用它来构建 .net 项目。我感兴趣的是有一个总结任务,它打印出已经完成的总结。无论使用什么任务调用 rake,我都希望始终调用此任务。
有没有简单的方法可以做到这一点?
谢谢
更新问题,回复Patrick's answer 我想要的是在所有其他任务之后运行一次之后的任务,所以我想要的输出是:
task :test1 do
puts 'test1'
end
task :test2 do
puts 'test2'
end
Rake::Task.tasks.each do |t|
<Insert rake magic here>
# t.enhance do
# puts 'after'
# end
end
$ rake test1
test1
after
$rake test2
test2
after
$rake test1 test2
test1
test2
after
如果
task :test3 =>[:test1, :test2]
puts 'test3'
end
$rake test3
test1
test2
test3
after
即使赏金已经消失,任何进一步的帮助都非常感谢。 (遗憾的是,我不认为我可以提供另一个赏金。)
【问题讨论】: