[Rake] call a task of a namespace from an other task.

S

Stéphane Wirtel

Hi all,

I try to call a task of a namespace from an other task !

Exemple:

ReleaseDirectory = File.join( "d:", "release" )

namespace :release do
task :create do
mkdir_p ReleaseDirectory, QUIET
end
end

namespace :kernel do
task :compile do
end

task :release => [ ???? ] do
end
end


"????" What can I put ? I would like to use the task ":create" of the
namespace ":release". Is there a way to resolve my problem ?

Thanks

Stephane Wirtel
 
S

Stéphane Wirtel

Ok, I found a solution but I don't know if it's a good solution.

I put the namespace :release in a variable.

Example:

releaseNs = namespace :release do
task :create do
mkdir_p ReleaseDirectory
end
end

namespace :kernel do
task :compile do
end

task :release => [ releaseNs[:create] ] do
end
end


What do you think of this solution ?
 
S

Stephane Wirtel

Bob Showalter a écrit :
Well, you're not strictly "calling" the task. You're making it a dependency
yes, sorry.

a dependency.

Do you think that my previous mail is a good solution ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top