-
Notifications
You must be signed in to change notification settings - Fork 8
/
Rakefile
37 lines (29 loc) · 861 Bytes
/
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
require "rake/testtask"
require "rake/clean"
ENV["MT_NO_PLUGINS"] = "1"
XML_FILE = "tmp/Opcodes/opcodes/x86_64.xml"
LICENCE_FILE = "tmp/Opcodes/license.rst"
LIB_FILE = "lib/fisk/instructions.rb"
INSNS_DIR = "lib/fisk/instructions"
file XML_FILE do
Dir.mkdir 'tmp' unless File.directory?("tmp")
cd "tmp" do
sh "git clone https://github.com/Maratyszcza/Opcodes.git"
end
end
file INSNS_DIR do
Dir.mkdir 'lib/fisk/instructions' unless File.directory?("lib/fisk/instructions")
end
file LIB_FILE => [XML_FILE, INSNS_DIR] do
ruby "bin/build-machine.rb #{XML_FILE} #{LICENCE_FILE} #{INSNS_DIR} > #{LIB_FILE}"
end
CLEAN.include LIB_FILE
CLEAN.include INSNS_DIR
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
t.warning = true
end
task :test => LIB_FILE
task :default => :test