-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
70 lines (59 loc) · 1.65 KB
/
Rakefile
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
require "fileutils"
task :default => :all
desc "Run all tasks"
task :all => ["steep_check", "rbs_doc:generate"]
desc "Setup"
task :setup => [:install_steep, :install_picoruby]
task :install_steep do
FileUtils.cd "lib" do
sh "bundle install"
end
end
PICORUBY_DIR = "picoruby"
MRUBYC_DIR = "picoruby/mrbgems/picoruby-mrubyc/lib/mrubyc"
desc "Git clone picoruby and mruby/c"
task :install_picoruby => [PICORUBY_DIR, MRUBYC_DIR]
directory PICORUBY_DIR do
sh "git clone https://github.com/picoruby/picoruby.git"
FileUtils.cd("picoruby") do
sh "git checkout use-builtin-Task"
end
FileUtils.cd("lib") do
sh "bundle install"
end
end
directory MRUBYC_DIR do
FileUtils.cd("picoruby/mrbgems/picoruby-mrubyc/lib") do
sh "git clone https://github.com/mrubyc/mrubyc.git"
FileUtils.cd("mrubyc") do
sh "git checkout fix-picoruby-irb"
end
end
end
desc "Run jekyll"
task :s do
sh "bundle exec jekyll serve"
end
desc "Run steep check"
task :steep_check do
FileUtils.cd PICORUBY_DIR do
sh "BUNDLE_GEMFILE=./Gemfile bundle exec rake steep"
end
end
namespace :rbs_doc do
desc "Generate documentation"
task :generate do |t, args|
work_dir = File.expand_path("../picoruby", __FILE__)
steepfile = File.expand_path("../picoruby/Steepfile", __FILE__)
output_dir = File.expand_path("../pages/rbs_doc", __FILE__)
sidebar_path = File.expand_path("../_data/sidebars/picoruby_sidebar.yml", __FILE__)
sh <<~CMD
BUNDLE_GEMFILE=./lib/Gemfile \
WORK_DIR=#{work_dir} \
STEEPFILE=#{steepfile} \
OUTPUT_DIR=#{output_dir} \
SIDEBAR_PATH=#{sidebar_path} \
bundle exec ruby lib/runner.rb
CMD
end
end