开发者

Rake Task Ordering

开发者 https://www.devze.com 2022-12-17 11:05 出处:网络
Suppose I have two top-level tasks: task :publicBuild => [:zipSourceCode, :copyPrivateKey] task :internalBuild => [:copyPrivateKey]

Suppose I have two top-level tasks:

task :publicBuild => [:zipSourceCode, :copyPrivateKey]
task :internalBuild => [:copyPrivateKey]

For the internalBuild task, I don't want to zip source code - I just want the private key. But for a p开发者_高级运维ublicBuild, I want to do both. But I need to guarantee that for the publicBuild, the zipSourceCode task is executed before the copyPrivateKey task (I don't want the source code ZIP to contain the public key).

A dependency such as copyPrivateKey => zipSourceCode wouldn't work because it would mean that for internalBuild, it would call zipSourceCode, which I don't want.

What I want to tell rake is "if these two tasks are to be executed, you should do this one first, but they are both optional". Is this possible?


As floyd said... the tasks should be performed in the order in which they appear in the dependency array.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号