-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathRakefile
More file actions
64 lines (54 loc) · 1.68 KB
/
Rakefile
File metadata and controls
64 lines (54 loc) · 1.68 KB
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
mruby_version = '1.4.1'
require_relative 'lib/wasm/colorize'
require_relative 'lib/wasm/version'
def print_task(task)
print "\n", "==> ".blue, task.bold, "\n\n"
end
task default: 'install_gem'
desc 'Uninstall the gem'
task :uninstall_gem do
print_task 'Uninstalling gem'
system 'gem uninstall wasm --executables'
end
desc 'Build the gem'
task :build_gem => :uninstall_gem do
print_task 'Building gem'
system 'gem build wasm.gemspec --verbose'
end
desc 'Install the gem'
task :install_gem => :build_gem do
print_task 'Installing gem'
system "gem install wasm-#{WASM::VERSION}.gem --local --verbose"
end
desc 'Clean the project build files'
task :clean do
print_task 'Cleaning build files'
FileUtils.remove_dir 'mruby/build', true
FileUtils.remove_dir 'assets/mruby', true
end
desc 'Build MRuby static library for WebAssembly'
task :build_mruby => :clean do
print_task 'Building MRuby static library for WebAssembly'
Dir.chdir('mruby') do
ENV['MRUBY_CONFIG'] = '../build_config.rb'
system 'rake'
end
FileUtils.mkdir_p 'assets/mruby'
FileUtils.cp_r 'mruby/include', 'assets/mruby'
FileUtils.cp 'mruby/build/emscripten/lib/libmruby.a', 'assets/mruby'
end
desc 'Set MRuby submodule to latest release'
task :mruby_latest do
print_task "Setting MRuby submodule to version #{mruby_version}"
system 'git submodule update --remote && '\
'cd mruby && '\
"git checkout tags/#{mruby_version}"
end
desc 'Set MRuby submodule to master branch'
task :mruby_master do
print_task 'Setting MRuby submodule to master branch'
system 'git submodule update --remote && '\
'cd mruby && '\
'git checkout master && '\
'git pull --rebase'
end