forked from pannous/english-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
executable file
·91 lines (75 loc) · 1.97 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
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
# require File.expand_path('../config/application', __FILE__)
require 'rake/clean'
require 'rake/testtask'
# require 'rspec/core/rake_task'
# Bundler::GemHelper.install_tasks
# desc "Run all examples"
# RSpec::Core::RakeTask.new(:spec)
# task :default => :spec
# task :test => :spec
# require "rubygems"
# gem 'hoe', '>= 2.1.0'
# require 'hoe'
#
# Hoe.plugins.delete :rubyforge
# Hoe.plugin :minitest
# Hoe.plugin :gemspec # `gem install hoe-gemspec`
# Hoe.plugin :git # `gem install hoe-git`
task :default => :shell #:test
# EnglishScript::Application.load_tasks
desc "running all tests"
task :test do
test_files = Dir['./test/unit/*_test.rb'] #FileList
p test_files
Rake::TestTask.new do |t|
$use_tree=false
$raking=true
$testing=true
t.libs << "test"
t.test_files = test_files
# t.verbose = true
t.verbose = false
end
# test_files.each{|f|$use_tree=false;system(f)}
end
desc "build binaries"
task :build do
# mkdir_p "build"
# system("mkdir -q build")
# system("mrbc ./src/core/english-parser.rb")
system("touch ./bin/angle")
# ruby("buildall.rb", "apps")
end
task :compile => :build
desc "run an angle file (interpreted)"
task :run, [:file_name] => [:compile] do |t, args|
system("./src/core/english-parser.rb #{args[:file_name]||''}")
end
task :start => :run
task :interpret => :run
# task :script => :run
task :emit => :compile
desc "start angle REPL shell"
task :shell do
begin
system("./src/core/english-parser.rb")
rescue Exception => e
puts e.to_s
end
end
task :script => :shell
task :anglescript => :shell
task :angle => :shell
task :init do
mkdir_p 'dist'
mkdir_p 'build'
end
desc "clean up build artifacts"
task :clean do
# ant.delete 'quiet' => true, 'dir' => 'build'
rm_f 'build/*'
rm_rf 'tmp'
end