diff options
| author | KOBAYASHI Shuji <[email protected]> | 2021-01-07 17:31:05 +0900 |
|---|---|---|
| committer | KOBAYASHI Shuji <[email protected]> | 2021-01-07 17:31:05 +0900 |
| commit | 0dfcaaed63b25623f19def2d8fff1ee9373b45d9 (patch) | |
| tree | e430d4690ce952a4de2d062a820c910b0d1c950b /tasks/doc.rake | |
| parent | ec6f46c05dfdf5bd7ef5c9a36ea1751ff564b2ef (diff) | |
| download | mruby-0dfcaaed63b25623f19def2d8fff1ee9373b45d9.tar.gz mruby-0dfcaaed63b25623f19def2d8fff1ee9373b45d9.zip | |
Use namespaces according to Rake conventions
Change the Rake task to one that uses namespaces as follows (previous task
names can also be used for compatibility).
| Previous Task | New Task |
|----------------|----------------|
| api_doc | doc:api |
| capi_doc | doc:capi |
| clean_doc | doc:clean |
| clean_api_doc | doc:clean:api |
| clean_capi_doc | doc:clean:capi |
| view_api | doc:view:api |
| view_capi | doc:view:capi |
| gitlab_config | gitlab:config |
| gitlab_dockers | gitlab:dockers |
Diffstat (limited to 'tasks/doc.rake')
| -rw-r--r-- | tasks/doc.rake | 88 |
1 files changed, 50 insertions, 38 deletions
diff --git a/tasks/doc.rake b/tasks/doc.rake index 11b76bb3f..8013ed038 100644 --- a/tasks/doc.rake +++ b/tasks/doc.rake @@ -1,48 +1,60 @@ desc 'generate document' -task :doc => [:api_doc, :capi_doc] do - -end - -desc 'generate yard docs' -task :api_doc do - begin - sh "mrbdoc" - rescue - puts "ERROR: To generate yard documentation, you should install yard-mruby gem." - puts " $ gem install yard-mruby yard-coderay" +task :doc => %w[doc:api doc:capi] + +namespace :doc do + desc 'generate yard docs' + task :api do + begin + sh "mrbdoc" + rescue + puts "ERROR: To generate yard documentation, you should install yard-mruby gem." + puts " $ gem install yard-mruby yard-coderay" + end end -end -desc 'generate doxygen docs' -task :capi_doc do - begin - sh "doxygen Doxyfile" - rescue - puts "ERROR: To generate C API documents, you need Doxygen." - puts " $ sudo apt-get install doxygen" + desc 'generate doxygen docs' + task :capi do + begin + sh "doxygen Doxyfile" + rescue + puts "ERROR: To generate C API documents, you need Doxygen." + puts " $ sudo apt-get install doxygen" + end end -end -desc 'clean all built docs' -task :clean_api_doc do - rm_rf 'doc/api' -end + desc 'clean all built docs' + task :clean => %w[clean:api clean:capi] -desc 'clean all built docs' -task :clean_capi_doc do - rm_rf 'doc/capi' -end + namespace :clean do + desc 'clean yard docs' + task :api do + rm_rf 'doc/api' + end -desc 'clean all built docs' -task :clean_doc => [:clean_api_doc, :clean_capi_doc] do -end + desc 'clean doxygen docs' + task :capi do + rm_rf 'doc/capi' + end + end -desc 'clean all built docs' -task :view_api => [:api_doc] do - sh 'xdg-open doc/api/index.html' -end + namespace :view do + desc 'open yard docs' + task :api do + sh 'xdg-open doc/api/index.html' + end -desc 'clean all built docs' -task :view_capi => [:capi_doc] do - sh 'xdg-open doc/capi/html/index.html' + desc 'open doxygen docs' + task :capi do + sh 'xdg-open doc/capi/html/index.html' + end + end end + +# deprecated +task "api_doc" => "doc:api" +task "capi_doc" => "doc:capi" +task "clean_doc" => "doc:clean" +task "clean_api_doc" => "doc:clean:api" +task "clean_capi_doc" => "doc:clean:capi" +task "view_api" => "doc:view:api" +task "view_capi" => "doc:view:capi" |
