Skip to content

Instantly share code, notes, and snippets.

@Nimster
Forked from jamiecobbett/Rakefile
Created September 16, 2011 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nimster/1223080 to your computer and use it in GitHub Desktop.
Save Nimster/1223080 to your computer and use it in GitHub Desktop.
Run a rake task for each rakefile in directories under the current one
# Adapted from http://stackoverflow.com/questions/1686779/multifile-rake-build
# Runs a task (in this case the default task) for each Rakefile nested in the current directory
task :default do
FileList["*/**/Rakefile"].each do |project|
next if project =~ /^admin_console/
next if project =~ /^logging/
# clear current tasks
Rake::Task.clear
#load tasks from this project
load project
if !Rake::Task.task_defined?(:default)
puts "No default task defined in #{project}, aborting!"
exit -1
else
dir = project.pathmap("%d")
Dir.chdir(dir) do
default_task = Rake::Task[:default]
default_task.invoke()
end
end
end
puts "Done building projects"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment