forked from rubinius/rubinius
/
doc.rake
75 lines (54 loc) · 1.95 KB
/
doc.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
require "fileutils"
namespace :doc do
desc "Generate HTML, LaTeX and man(3) documentation from codebase."
task :doxygen => "doc:doxygen:generate"
desc "Generate opcode docs."
task :opcode => "doc:opcode:generate"
desc "Delete all generated documentation"
task :clean => %w[doc:doxygen:clean doc:opcode:clean]
# TODO: rename task to :vm and make it a dependency for doc:build.
namespace :doxygen do
directory "doc/generated/vm"
desc "Generate HTML, LaTeX and man(3) documentation from codebase."
task :generate => %w[doc/generated/vm doc/vm/doxygen.conf] do
sh "doxygen doc/vm/doxygen.conf"
end
desc "Delete all documentation generated by Doxygen"
task :clean do
if File.directory? "doc/generated/vm"
FileUtils.rm_r "doc/generated/vm", :secure => true, :verbose => $verbose
end
end
end
# TODO: rename task to :build and generalize for all generated
# documentation, not just opcode docs.
namespace :opcode do
desc "Generate opcode documentation HTML"
task :generate => "doc/vm/toc.html"
directory "doc/generated/opcode"
file 'doc/generated/opcode/toc.html' => %w[
doc/generated/opcode shotgun/lib/instructions.rb] do
rbx 'doc/vm/gen_op_code_html.rb'
end
rule '.html' => %w[.txt doc/vm/rdoc.rb] do |t|
rbx 'doc/vm/rdoc.rb', t.source, t.name
end
task :html => %w[
build
doc/generated/opcode/toc.html
doc/generated/opcode/concurrency.html
doc/generated/opcode/intro.html
doc/generated/opcode/method_dispatch.html
doc/generated/opcode/rbc_files.html
doc/generated/opcode/rubinius_vs_mri.html
doc/generated/opcode/shotgun.html
doc/generated/opcode/vm_interfaces.html
]
desc "Remove all generated opcode docs"
task :clean do
Dir.glob('doc/generated/opcode/**/*.html').each do |html|
rm_f html unless html =~ /\/?index.html$/
end
end
end
end