2016-10-08 32 views
2

在Ruby(RAKE),您可以通過以下方式有沒有一個選項列出目標(可能與描述)在假?

# rakefile 
desc "cleans ./temp" 
task :clean do 
    p :cleaning 
end 

desc "compile the source" 
task :compile => :clean do 
    p :compiling 
end 

$ rake -T # Display the tasks with descriptions, then exit. 
rake clean # cleans ./temp 
rake compile # compile the source 

記錄您的任務,這可能與假?

+1

源是它不相似[本SO問題]當(http://stackoverflow.com/questions/32017021/how-do-you-add-a-description-to-a-fake-target)? –

回答

2

這同樣在FAKE實現,如我發現讀

// build.fsx 

Description "remove temp/" 
Target "Clean" (fun _ -> 
    CleanDirs [buildDir; deployDir] 
) 
// ....so on 

依賴圖被示爲具有.../fake.exe --listTargets-lt

Available targets: 
    - Clean - remove temp/ 
    Depends on: [] 
    - Build 
    Depends on: ["Clean"] 
    - Deploy 
    Depends on: ["Test"] 
    - Test 
    Depends on: ["Build"] 
相關問題