/
Rakefile
152 lines (113 loc) · 3.61 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# NOTE! When updating this file, also update INSTALL, if necessary.
# NOTE! Please keep your tasks grouped together.
$trace ||= false
$VERBOSE = true
$verbose = Rake.application.options.trace || ARGV.delete("-v")
if !$verbose and respond_to?(:verbose)
verbose(false) if verbose() == :default
end
config_rb = File.expand_path "../config.rb", __FILE__
config_h = File.expand_path "../vm/gen/config.h", __FILE__
unless File.exists?(config_rb) and File.exists?(config_h)
STDERR.puts "Please run ./configure first"
exit 1
end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG
unless BUILD_CONFIG[:config_version] == 7
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
$dlext = Config::CONFIG["DLEXT"]
$: << "lib"
task :default => %w[build vm:test] do
unless File.directory? BUILD_CONFIG[:runtime]
# Setting these enables the specs to run when rbx has been configured
# to be installed, but rake install has not been run yet.
ENV["RBX_RUNTIME"] = File.expand_path "../runtime", __FILE__
ENV["RBX_LIB"] = File.expand_path "../lib", __FILE__
ENV["CFLAGS"] = "-Ivm/capi"
end
sh "bin/mspec ci --background"
end
# See vm.rake for more information
desc "Build everything that needs to be built at default level."
task :build => ["build:normal", "gem_bootstrap"]
desc "Recompile all ruby system files"
task :rebuild => %w[clean build]
desc "Use to run Rubinius in CI"
task :ci do
unless system("rake -q")
puts "<< ERROR IN CI, CLEANING AND RERUNNING >>"
system "rake -q clean"
system "find . -name *.rbc -delete"
sh "rake -q"
end
end
desc 'Remove rubinius build files'
task :clean => %w[
vm:clean
kernel:clean
clean:crap
extensions:clean
]
desc 'Remove rubinius build files and external library build files'
task :distclean => %w[
clean
vm:distclean
]
namespace :clean do
desc "Cleans up editor files and other misc crap"
task :crap do
files = (Dir["*~"] + Dir["**/*~"]).uniq
rm_f files, :verbose => $verbose unless files.empty?
end
end
desc 'Move the preinstalled gem setup into place'
task :gem_bootstrap do
unless File.directory?("gems/rubinius")
sh "mkdir -p gems/rubinius"
sh "cp -r preinstalled-gems/bin gems/bin"
sh "cp -r preinstalled-gems/data gems/rubinius/preinstalled"
end
end
desc "Documents why no spec tasks exist"
task :spec do
puts <<-EOM
The spec and spec:xxx commands are deprecated (and removed).
Use bin/mspec directly. MSpec provides 'pseudo-directories',
which are labels that refer to sets of specs to run. Refer
to spec/default.mspec, spec/full.mspec and the MSpec docs
for full details.
The following are likely scenarios for running the specs.
Unless -t <target> is passed to mspec, bin/rbx is run.
Run the CI specs that are run with the default 'rake' command
bin/mspec ci
Run _all_ the CI spec:
bin/mspec ci -B full
Run all the frozen specs:
bin/mspec
Run all the frozen Array specs:
bin/mspec core/array
OR
bin/mspec spec/frozen/core/array
Run spec/frozen/core/array/append_spec.rb:
bin/mspec core/array/append
OR
bin/mspec spec/frozen/core/array/append_spec.rb
Run all the compiler specs:
bin/mspec :compiler
Run all the [language, core, library, capi] specs:
bin/mspec :language
bin/mspec :core
...
Run all the spec/ruby specs using the MRI on your path
(assuming you have run 'rake rubyspec:update'):
bin/mspec -tr :ruby
EOM
end
desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
task :todos do
sh "grep", "-Rn", "@todo", "kernel"
sh "grep", "-Rn", "TODO", "kernel"
end