[Rake-devel] Multiple Rakefile build

Leon Yeh leon at newavenue.net
Fri Dec 2 18:15:17 EST 2005

Hi Patrick, thanks for the information. Do you mind to cut and paste 
your code ? so can I learn from it and patch my rake.rb.

Thank you
Leon Yeh

Bennett, Patrick wrote:
> I modified my rake.rb to support this via an additional command that
> specified subdirectories to get added to a queue.
> Rake then iterates through this queue loading the rakefiles and
> executing them [clearing out all tasks between].
> It doesn't work like make either, where people frequently recursively
> launch new copies of make for each makefile.  Obviously, that would be
> horribly inefficient.
>>-----Original Message-----
>>From: rake-devel-bounces at rubyforge.org 
>>[mailto:rake-devel-bounces at rubyforge.org] On Behalf Of Leon Yeh
>>Sent: Friday, December 02, 2005 5:54 PM
>>To: rake-devel at rubyforge.org
>>Subject: [Rake-devel] Multiple Rakefile build
>>Hi All, I have just started using Rake, I usually use ant, 
>>but got caught the Ruby fever :-)
>>I have been using RoR for web development and in need rake to 
>>do data migration. I wanted to build a hirarchical build 
>>system similar to Makefile. Example below
>>	Rakefile
>>	\task_migrate_empTable
>>		Rakefile
>>		drop_empTable.rb
>>		create_empTable.rb
>>		..
>>	\task_migrate_salesTable
>>		Rakefile
>>		drop_salesTable.rb
>>		create_salesTable.rb
>>What I want to do is that the top-level Rakefile go thru the 
>>folders and
>>  invoke each of Rakefile. Below is my first rakefile, but it 
>>was not working. What is the correct way to do this ? Any 
>>help are greatly appreciated.
>>require 'rake'
>>desc "Migrate Employee Table"
>>task :employeeTbl do	
>>	cd "task_empTbl"	
>>	Rake.application.load_rakefile()
>>	Rake.application.run()
>>	cd "../"
>>task :default => [
>>	:distributorTbl,
>>	:employeeTbl
>>Thanks in advance
>>Leon Yeh
>>Rake-devel mailing list
>>Rake-devel at rubyforge.org
> _______________________________________________
> Rake-devel mailing list
> Rake-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rake-devel

More information about the Rake-devel mailing list