-
Notifications
You must be signed in to change notification settings - Fork 17
/
rakefile
55 lines (45 loc) · 1.22 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
require 'erb'
generated = ["build/cycloa.js", "build/cycloa_script.js"];
task :default => generated;
def concat(files, to)
src = files.reduce(""){|memo, t|
puts "reading #{t} for #{to}"
memo += open(t, "r").read
}
open(to,"w") { |f|
f.print src
}
end
file "build/cycloa.js" => "js/cycloa/vm.js" do |t|
concat(["js/cycloa/cycloa.js",
"js/cycloa/err.js",
"js/cycloa/util.js",
"js/cycloa/trace.js",
"js/cycloa/default_fairy.js",
"js/cycloa/vm.js",
"js/fairy.js",
"js/interface_vm.js"], t.name);
end
file "build/cycloa_script.js" => "js/cycloa/script.js" do |t|
concat(["js/cycloa/cycloa.js",
"js/cycloa/err.js",
"js/cycloa/util.js",
"js/cycloa/trace.js",
"js/cycloa/default_fairy.js",
"js/cycloa/script.js",
"js/fairy.js",
"js/interface_script.js"], t.name);
end
file "js/cycloa/vm.js" => FileList["src/vm*.erb.js", "src/*.rb"] do |t|
puts "generating emulation core"
sh "erb src/vm.erb.js > #{t.name}"
end
file "js/cycloa/script.js" => FileList["src/vm*.erb.js", "src/*.rb", "src/script.erb.js"] do |t|
puts "generating script machine core"
sh "erb src/script.erb.js > #{t.name}"
end
task :clean do
rm "js/cycloa/vm.js"
rm "js/cycloa/script.js"
rm generated
end