-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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