我已经编译在两个方面项目Rake文件,根据全局变量$build_type,它可以是:debug或:release(结果走在不同的目录):
task :build => [:some_other_tasks] do
end
Run Code Online (Sandbox Code Playgroud)
我希望创建一个任务,依次编译项目的两个配置,如下所示:
task :build_all do
[ :debug, :release ].each do |t|
$build_type = t
# call task :build with all the tasks it depends on (?)
end
end
Run Code Online (Sandbox Code Playgroud)
有没有办法将任务称为方法?或者我怎样才能达到类似的效果呢?