我有一个Rakefile,它以两种方式编译项目,根据全局变量$build_type
,可以是:debug
或:release
(结果在不同的目录中):
task :build => [:some_other_tasks] do
end
我想创建一个任务,编译项目的两个配置依次,像这样:
task :build_all do
[ :debug, :release ].each do |t|
$build_type = t
# call task :build with all the tasks it depends on (?)
end
end
是否有一种方法可以像调用方法一样调用任务?或者我怎样才能实现类似的目标?