7
如何从Rake任务中运行Rake任务?
我有一个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 有没有办法像调用方法一样调用任务?还是我可以实现类似的目标?