-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
78 lines (63 loc) · 1.41 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
71
72
73
74
75
76
77
78
require_relative "./config"
require_relative "./task/agent/host"
require_relative "./task/agent/wasm"
host_agent = HostAgent.new(
app_name: Devkit::AppName,
debug: Devkit::Debug
)
wasm_agent = WasmAgent.new(
app_name: Devkit::AppName,
debug: Devkit::Debug
)
namespace :mruby do
# desc "init mruby"
task :init do
if !host_agent.mruby_dir.exist?
host_agent.clean_all
host_agent.mruby_download
end
config_changed = host_agent.config_changed
if config_changed
host_agent.mruby_config
end
if !host_agent.mruby_build_dir.exist? || config_changed
host_agent.mruby_build
end
end
task :init_wasm => [:"mruby:init"] do
config_changed = wasm_agent.config_changed
if config_changed
wasm_agent.mruby_config
end
if !wasm_agent.mruby_build_dir.exist? || config_changed
wasm_agent.mruby_build
end
end
# desc "download mruby"
task :download do
host_agent.mruby_download
end
end
desc "run program"
task :run => [:"mruby:init"] do
host_agent.run
end
desc "build program"
task :build => [:"mruby:init"] do
host_agent.build
end
desc "run wasm program"
task :"run:wasm" => [:"mruby:init_wasm"] do
wasm_agent.run
end
desc "build wasm program"
task :"build:wasm" => [:"mruby:init_wasm"] do
wasm_agent.build
end
desc "release package"
task :release => [:"build"] do
host_agent.release
end
task :default do
system("rake -T")
end