Unverified Commit 1cc1ade6 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5263 from shuujii/use-namespaces-according-to-Rake-conventions

Use namespaces according to Rake conventions
parents 76241a96 0dfcaaed
desc 'generate document' desc 'generate document'
task :doc => [:api_doc, :capi_doc] do task :doc => %w[doc:api doc:capi]
end namespace :doc do
desc 'generate yard docs'
desc 'generate yard docs' task :api do
task :api_doc do
begin begin
sh "mrbdoc" sh "mrbdoc"
rescue rescue
puts "ERROR: To generate yard documentation, you should install yard-mruby gem." puts "ERROR: To generate yard documentation, you should install yard-mruby gem."
puts " $ gem install yard-mruby yard-coderay" puts " $ gem install yard-mruby yard-coderay"
end end
end end
desc 'generate doxygen docs' desc 'generate doxygen docs'
task :capi_doc do task :capi do
begin begin
sh "doxygen Doxyfile" sh "doxygen Doxyfile"
rescue rescue
puts "ERROR: To generate C API documents, you need Doxygen." puts "ERROR: To generate C API documents, you need Doxygen."
puts " $ sudo apt-get install doxygen" puts " $ sudo apt-get install doxygen"
end end
end end
desc 'clean all built docs'
task :clean => %w[clean:api clean:capi]
desc 'clean all built docs' namespace :clean do
task :clean_api_doc do desc 'clean yard docs'
task :api do
rm_rf 'doc/api' rm_rf 'doc/api'
end end
desc 'clean all built docs' desc 'clean doxygen docs'
task :clean_capi_doc do task :capi do
rm_rf 'doc/capi' rm_rf 'doc/capi'
end end
end
desc 'clean all built docs'
task :clean_doc => [:clean_api_doc, :clean_capi_doc] do
end
desc 'clean all built docs' namespace :view do
task :view_api => [:api_doc] do desc 'open yard docs'
task :api do
sh 'xdg-open doc/api/index.html' sh 'xdg-open doc/api/index.html'
end end
desc 'clean all built docs' desc 'open doxygen docs'
task :view_capi => [:capi_doc] do task :capi do
sh 'xdg-open doc/capi/html/index.html' sh 'xdg-open doc/capi/html/index.html'
end
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"
...@@ -25,8 +25,9 @@ def run_cmd(cmd) ...@@ -25,8 +25,9 @@ def run_cmd(cmd)
raise 'error' unless system cmd raise 'error' unless system cmd
end end
desc 'recreate docker images for GitLab builds' namespace :gitlab do
task :gitlab_dockers do desc 'recreate docker images for GitLab builds'
task :dockers do
CI_COMPILERS.each do |compiler| CI_COMPILERS.each do |compiler|
tag = ci_image_tag(compiler) tag = ci_image_tag(compiler)
filename = "Dockerfile.#{tag}" filename = "Dockerfile.#{tag}"
...@@ -54,10 +55,10 @@ task :gitlab_dockers do ...@@ -54,10 +55,10 @@ task :gitlab_dockers do
run_cmd cmd2 run_cmd cmd2
File.delete(filename) File.delete(filename)
end end
end end
desc 'create build configurations and update .gitlab-ci.yml' desc 'create build configurations and update .gitlab-ci.yml'
task :gitlab_config do task :config do
require 'yaml' require 'yaml'
configs = [] configs = []
...@@ -112,4 +113,9 @@ task :gitlab_config do ...@@ -112,4 +113,9 @@ task :gitlab_config do
end end
end end
File.open(path, 'w') { |f| YAML.dump(data, f) } File.open(path, 'w') { |f| YAML.dump(data, f) }
end
end end
# deprecated
task "gitlab_config" => "gitlab:config"
task "gitlab_dockers" => "gitlab:dockers"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment