I've read some posts, tips and tutorials about using rake arguments and rake multitask. The following would be some simple examples.
multitask 'build_parallel' => ['build_a', 'build_z']
or
multitask :mytask => [:task1, :task2, :task3] do
puts "Completed parallel execution of tasks 1 through 3."
end
My question:
What is the best way to build a global variable in one task that I can then use in my multitask? The following doesn't execute task1, task2, task3...which means the global $build_list is empty
$build_list = []
task :build do
$build_list << 'task1'
$build_list << 'task2'
$build_list << 'task3'
Rake::MultiTask[:build_parallel].invoke # or Rake::Task[:build_parallel].invoke
end
multitask :build_parallel => $build_list
Should I be using an ENV variable here or is some other method preferred?