Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 643 lines (537 sloc) 17.245 kB
31418f9 got rid of ugly compare.rb now just type "rake build_reports" and ope…
Mae authored
1 ROOT = File.expand_path(File.dirname(__FILE__))
2
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
3 def require_files(files)
4 files.each do |path|
3667fc9 @evanphx With this revision, we begin the time of the generational GC.
evanphx authored
5 begin
6 require(path)
7 rescue Object => e
8 STDERR.puts "Unable to load #{path}. #{e.message} (#{e.class})"
9 end
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
10 end
11 end
12
7d88640 @brixen fixed the rspec dependency in Rakefile. If rspec is not installed, th…
brixen authored
13 begin
14 require 'spec/rake/spectask'
15 rescue LoadError
c3f12a3 @brixen Made rspec a requirement of the build problem. Updated README and mov…
brixen authored
16 raise <<-EOM
17 Unable to load spec/rake/spectask. RSpec is a requirement to build Rubinius.
18 Please install RSpec before building (http://rspec.rubyforge.org).
19 EOM
7d88640 @brixen fixed the rspec dependency in Rakefile. If rspec is not installed, th…
brixen authored
20 end
42b5e9f @brixen added spec tasks :only to run only spec, :language for high level lan…
brixen authored
21
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
22 # specify the compiler to use
23 COMPILER="../bin/obsolete.rcompile"
24 # COMPILER="../shotgun/rubinius -c"
25
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
26 # require local rake libs
27 # doesn't do anything gracefully on load error (yet)
28 paths = Dir[ File.join(File.dirname(__FILE__), 'rake/*') ]
c3f12a3 @brixen Made rspec a requirement of the build problem. Updated README and mov…
brixen authored
29 require_files(paths)
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
30
42b5e9f @brixen added spec tasks :only to run only spec, :language for high level lan…
brixen authored
31 # By default, run all the specs and tests
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
32 task :default => :spec
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
33
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
34 desc 'Run all specs'
35 task :spec => 'spec:new'
36 #desc "Run all specs and tests."
37 #task :spec do
38 # Rake::Task['spec:all'].invoke rescue got_error = true
39 #
40 # raise "Spec or test failures." if got_error
41 #end
6a03730 @evanphx Cleaned up some of the includes and fixed up the Rakefile to run the …
evanphx authored
42
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
43 namespace :spec do
44 desc "Run all specs and tests."
45 task :all do
42b5e9f @brixen added spec tasks :only to run only spec, :language for high level lan…
brixen authored
46 Rake::Task['spec:only'].invoke rescue got_error = true
47 Rake::Task['test:all'].invoke rescue got_error = true
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
48
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
49 raise "Spec or test failures." if got_error
50 end
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
51
52 desc "Setup code-cache directory"
53 task :setup => 'setup:code_cache'
54
55 namespace :setup do
56 desc "Setup code-cache directory"
57 task :code_cache do
58 Dir.mkdir "code-cache" unless File.exists?("code-cache")
59 FileUtils.rm Dir.glob("code-cache/*")
60 end
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
61
62 task :subtend do
63 Dir[File.join(File.dirname(__FILE__),"spec/subtend/**/Rakefile")].each do |rakefile|
64 sh "rake -f #{rakefile}"
65 end
66 end
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
67 end
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
68
42b5e9f @brixen added spec tasks :only to run only spec, :language for high level lan…
brixen authored
69 desc "Run only specs but not any tests."
f68ad63 - Remove printf from cpu_raise_primitive_failure so that the screen d…
Mae authored
70 spec_targets = %w(language shotgun library core targets primitives)
917cd03 @brixen checking in Alan Hurdles patch to allow running specific files, e.g. …
brixen authored
71
72 # Convenience method to run a single spec test
73 spec_targets.each do |group|
74 spec_files = Dir[ File.join(File.dirname(__FILE__),"spec/#{group}/*_spec.rb") ]
75 GroupSpecTask.new(group)
76 namespace group do
77 spec_files.each do |file|
78 SpecificGroupSpecTask.new(File.basename(file, '_spec.rb'), :core)
79 end
80 end
81 end
82
0ff86ac @evanphx Fixed up sirb and added a little extra VM support so that the locals …
evanphx authored
83
917cd03 @brixen checking in Alan Hurdles patch to allow running specific files, e.g. …
brixen authored
84 task :only => spec_targets.collect! { |g| 'spec:' << g }
c15c7d0 rcov for library specs
Mae authored
85
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
86 # experimental -- need to adjust exclusions depending on what your testing
87 namespace :coverage do
88 desc "Generate a coverage report for the library specs."
89 GroupCoverageReport.new(:library)
cdfdc27 Added my idea of a sanity check against MRI for compatibility purposes
Mae authored
90
d1bd375 Pruned spec section of Rakefile and abstracted some common-ness
Mae authored
91 desc "Generate a coverage report for the core specs."
92 GroupCoverageReport.new(:core)
cdfdc27 Added my idea of a sanity check against MRI for compatibility purposes
Mae authored
93 end
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
94
95 # New runner
96 desc 'Run all specs'
97 task :new do
98 system 'bin/specrunner spec'
99 end
100
101 # Specdiffs to make it easier to see what your changes have affected :)
102 desc 'Run specs and produce a diff against current base'
103 task :diff => 'diff:run'
104
105 namespace :diff do
106 desc 'Run specs and produce a diff against current base'
107 task :run do
108 system 'bin/specrunner spec > /tmp/rbs_specdiff'
109 system 'diff -u spec/diffs/base.txt /tmp/rbs_specdiff'
110 system 'rm /tmp/rbs_specdiff'
111 end
112
113 desc 'Replace the base spec file with a new one'
114 task :replace do
115 system 'bin/specrunner spec > spec/diffs/base.txt'
116 end
117 end
0ff86ac @evanphx Fixed up sirb and added a little extra VM support so that the locals …
evanphx authored
118 end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
119
48b8303 @brixen Changed rake test to be an alias of rake test:all. previous rake test…
brixen authored
120 desc "Alias for test:all"
121 task :test => 'test:all'
122
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
123 namespace :test do
124 desc "Run all tests."
125 task :all do
126 Rake::Task['test:core'].invoke rescue got_error = true
127 Rake::Task['test:shotgun'].invoke rescue got_error = true
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
128
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
129 raise "Test failures." if got_error
130 end
62fcdfc add a test:bfts task - doesn't use rubinius yet
Alexander Kellett authored
131
f3da43a summary: test:nativebfts
Alexander Kellett authored
132 desc "Runs BFTS on Ruby 1.8.*."
62fcdfc add a test:bfts task - doesn't use rubinius yet
Alexander Kellett authored
133 task :bfts do
134 system("ruby -Inative -Ibfts/overlay bfts/overlay/tc_all.rb")
135 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
136
f3da43a summary: test:nativebfts
Alexander Kellett authored
137 desc "Runs part of BFTS under Rubinius natively."
9446025 add code_cache dep to nativebfts also
Alexander Kellett authored
138 task :nativebfts => ['test:setup:code_cache'] do
ee10ad2 further file shuffles to decrease the complexities of the relative paths
Alexander Kellett authored
139 system("ruby -Ibfts/overlay bfts/overlay/test_stuff.rb")
f3da43a summary: test:nativebfts
Alexander Kellett authored
140 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
141
f3da43a summary: test:nativebfts
Alexander Kellett authored
142 desc "Run rubinius's 1.8.* tests."
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
143 task :core do
144 system("ruby -Ilib test/tc_all.rb")
145 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
146
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
147 desc "Run shotgun's core tests."
148 task :shotgun => ['test:setup:code_cache'] do
149 system("ruby test/tc_all.rb shotgun-tests")
150 end
151
152 namespace :setup do
153 desc "Prepare the code-cache directory"
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
154 task :code_cache => 'spec:setup:code_cache'
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
155 end
156 end
157
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
158 desc "Build the whole project"
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
159 task :build => 'build:all'
160
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
161 desc "Rebuild all parts and archives from scratch."
162 task :rebuild => ['build:clean', 'build:delete_rbc', 'build:delete_rba', 'build:setup:syd',
163 'build:shotgun', 'build:bootstrap', 'build:core', 'build:library', 'build:compiler']
164
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
165 namespace :build do
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
166
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
167 desc "Build rubinius (shotgun)."
7cd9d1e not perfect, but somewhat closer to reality
Cabo authored
168 task :all => ['build:clean', 'build:shotgun']
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
169
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
170 desc "Cleanup build files."
171 task :clean do
172 FileUtils.rm_rf 'code-cache'
173 FileUtils.rm Dir.glob('lib/kernel.rb*')
4c77303 @evanphx Make find exit cleanly
evanphx authored
174 sh "(find native -name '*.rbc' | xargs rm) || true"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
175 Dir.chdir('shotgun') do
8322ab6 @brixen rake build should now work even when make clean fails.
brixen authored
176 sh 'make -e clean || true'
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
177 end
178 end
179
699b453 @evanphx Farewell jmpbuf.h, you were a bitch anyway. All hail PortableUContext!
evanphx authored
180 desc "Rebuild librubinius"
181 task :relib do
182 sh 'make -C shotgun/lib clean'
183 sh 'make'
184 end
185
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
186 task :configure do
187 system('./configure')
188 raise 'Failed to configure shotgun components' if $?.exitstatus != 0
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
189 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
190
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
191 task :setup do
192 sh "ruby bin/rcc"
193 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
194
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
195 namespace :setup do
196 desc "Ensure that the correct version of the sydparse gem is installed."
197 task :syd do
198 require 'rubygems'
199 begin
200 require_gem 'sydparse', '>= 1.2.1'
201 rescue Gem::LoadError
202 puts "\nYour system does not have the required sysparse gem installed...\n"
203 Rake::Task['syd'].invoke
204 raise "Gem 'sydparse' must be installed from externals/syd-parser/pkg directory. Then re-run 'rake build'."
205 end
206 end
207 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
208
7cd9d1e not perfect, but somewhat closer to reality
Cabo authored
209 task :fields => ['setup:syd'] do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
210 $:.unshift "lib"
211 require 'types'
79bedbe Fix some hash functions and improve MRI compiliance - also added a ne…
Defn authored
212 fd = File.open("kernel/bootstrap/00auto_fields.rb", "w")
552e0c1 @evanphx A bunch of compiler fixes as well as the ability to install rubinius!
evanphx authored
213 hfd = File.open("kernel/hints", "w")
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
214 hints = {}
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
215 Rubinius::Types.each do |name, mod|
216 next if mod::TotalFields.size == 0
217 sname = mod.name.split("::").last
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
218 sub = {}
552e0c1 @evanphx A bunch of compiler fixes as well as the ability to install rubinius!
evanphx authored
219 hfd.puts sname
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
220 fd.puts "class #{sname}"
221 idx = 0
222 str = []
223 mod::TotalFields.each do |fel|
224 if fel == :instance_variables
225 fel = :__ivars__
226 end
552e0c1 @evanphx A bunch of compiler fixes as well as the ability to install rubinius!
evanphx authored
227 hfd.puts fel
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
228 sub["@#{fel}".to_sym] = idx
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
229 str << [":#{fel} => #{idx}"]
230 # fd.puts "index_accessor :#{fel}, #{idx}"
231 fd.puts " def #{fel}; Ruby.asm \"push self\\npush #{idx}\\nfetch_field\"; end"
232 idx += 1
233 end
552e0c1 @evanphx A bunch of compiler fixes as well as the ability to install rubinius!
evanphx authored
234 hfd.puts "!"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
235 hints[sname] = sub
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
236 fd.puts " ivar_as_index #{str.join(", ")}"
237 fd.puts "end"
238 end
239 fd.close
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
240
552e0c1 @evanphx A bunch of compiler fixes as well as the ability to install rubinius!
evanphx authored
241 #require 'yaml'
242 #File.open("kernel/hints", "w") do |f|
243 # f << hints.to_yaml
244 #end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
245 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
246
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
247 desc "Build shotgun C components."
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
248 task :shotgun => ['build:setup', 'spec:setup:code_cache', 'build:configure'] do
ffef2ca Allow environment variables to overide shotgun/lib/Makefile ones, by …
Frederick authored
249 system("make -e -C shotgun rubinius")
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
250 raise 'Failed to build shotgun components' if $?.exitstatus != 0
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
251 end
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
252
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
253 desc "Install rubinius"
254 task :install => 'build:shotgun' do
255 system("#{ENV['SUDO']} make install")
256 raise 'Failed to install rubinius' if $?.exitstatus != 0
257 end
258
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
259 FileList['lib/types/*.rb'].each do |src|
260 file 'kernel/hints' => src
261 end
262
263 file 'kernel/hints' do
264 puts "Building hints and fields..."
265 Rake::Task['build:fields'].invoke
266 end
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
267
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
268 def newer?(file, cmp)
269 File.exists?(cmp) and File.mtime(cmp) >= File.mtime(file)
270 end
271
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
272 desc "Build the VM bootstrap archive."
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
273 task :bootstrap => 'kernel/hints' do
274 Dir.chdir "kernel" do
275 files = Dir["bootstrap/*.rb"].sort
276
277 changed = []
278 files.each do |file|
279 cmp = "#{file}c"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
280 unless newer?(file, cmp) # File.exists?(cmp) and File.mtime(cmp) >= File.mtime(file)
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
281 changed << cmp
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
282 system "#{COMPILER} #{file}"
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
283 raise "Failed to compile #{file}" if $?.exitstatus != 0
284 end
285 file << "c"
286 end
287
288 File.open(".load_order.txt","w") do |f|
289 f.puts files.join("\n")
290 end
291
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
292 archive = "../runtime/bootstrap.rba"
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
293
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
294 if File.exists? archive
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
295 if changed.empty?
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
296 puts "No kernel/bootstrap files to update."
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
297 else
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
298 system "zip -u #{archive} .load_order.txt #{changed.join(' ')}"
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
299 end
300 else
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
301 system "zip #{archive} .load_order.txt #{files.join(' ')}"
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
302 end
303 end
304 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
305
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
306 desc "Build the core classes and methods archive."
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
307 task :core => 'kernel/hints' do
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
308 files = nil
309 Dir.chdir("kernel") do
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
310 files = Dir["core/*.rb"].sort
311 files.delete "core/__loader.rb"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
312
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
313 files << "core/__loader.rb"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
314
315 changed = []
316 files.each do |file|
317 cmp = "#{file}c"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
318 unless newer?(file, cmp) # File.exists?(cmp) and File.mtime(cmp) >= File.mtime(file)
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
319 changed << cmp
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
320 system "#{COMPILER} #{file}"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
321 raise "Failed to compile #{file}" if $?.exitstatus != 0
322 end
323 file << "c"
324 end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
325
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
326 File.open(".load_order.txt","w") do |f|
327 f.puts files.join("\n")
328 end
329
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
330 archive = "../runtime/core.rba"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
331
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
332 if File.exists? archive
333 if changed.empty?
334 puts "No kernel/core files to update."
335 else
336 system "zip -u #{archive} .load_order.txt #{changed.join(' ')}"
337 end
338 else
339 system "zip #{archive} .load_order.txt #{files.join(' ')}"
340 end
341 end
342 end
343
344 desc "Build the standard library."
345 task :library do
346 Dir.chdir('library') do
347 files = Dir['**/*.rb']
348 changed = []
349 files.each do |file|
350 cmp = "#{file}c"
351 unless newer?(file, cmp)
352 changed << cmp
353 system "#{COMPILER} #{file}"
354 raise "Failed to compile #{file}" if $?.exitstatus != 0
355 end
356 file << 'c'
357 end
358
359 archive = "../runtime/library.rba"
360
361 if File.exists? archive
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
362 if changed.empty?
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
363 puts "No library files to update."
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
364 else
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
365 system "zip -u #{archive} #{changed.join(' ')}"
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
366 end
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
367 else
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
368 system "zip #{archive} #{files.join(' ')}"
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
369 end
370 end
371 end
372
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
373 desc "Build syd-parser."
374 task :syd do
375 puts "Building externals/syd-parser gem...\n"
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
376 Dir.chdir('externals/syd-parser')
377 system("rake gem")
378 raise 'Failed to build externals/syd-parser gem' if $?.exitstatus != 0
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
379 puts "\nNow do 'gem install externals/syd-parser/pkg/*.gem' as your gem superuser.\n\n"
380 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
381
39b763c @evanphx Fixed the rake tasks for the compiler and added more ignores
evanphx authored
382 namespace :compiler do
383 desc "Bootstrap the compiler."
384 task :bootstrap do
385 files = %w! bytecode/compiler bytecode/assembler bytecode/encoder
386 sexp/simple_processor translation/normalize translation/local_scoping
387 sexp/composite_processor translation/states sexp/exceptions
388 bytecode/primitive_names!
389
390 files.each do |name|
391 file = "#{name}.rb"
392 dir = File.dirname(file)
393 dest_dir = File.join("native", dir)
394 path = File.expand_path File.join("lib", file)
395 dest = File.join("native", file)
396 FileUtils.mkdir_p dest_dir
397 FileUtils.symlink path, dest rescue nil
398 Dir.chdir "native" do
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
399 sh "#{COMPILER} #{file}"
39b763c @evanphx Fixed the rake tasks for the compiler and added more ignores
evanphx authored
400 end
401 raise "Failed to compile #{dest}" if $?.exitstatus != 0
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
402 end
ca67813 @evanphx WOO! This commit marks the beginning of the self hosting era!
evanphx authored
403
39b763c @evanphx Fixed the rake tasks for the compiler and added more ignores
evanphx authored
404 extra = %w!bytecode/rubinius!
405 extra.each do |name|
406 Dir.chdir "native" do
a33c588 Processing for ihash nodes (implicit hashes in method calls.)
Eero Saynatkari authored
407 file = name + '.rb'
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
408 sh "#{COMPILER} #{name}.rb"
a33c588 Processing for ihash nodes (implicit hashes in method calls.)
Eero Saynatkari authored
409 end
410 raise "Failed to compile native/#{name}" if $?.exitstatus != 0
411 end
412 end
f83e9ee @brixen removed grammar.c from version control, added it to clean target. add…
brixen authored
413
39b763c @evanphx Fixed the rake tasks for the compiler and added more ignores
evanphx authored
414 desc "Package up the compiler"
415 task :package do
416 File.unlink "compiler.rba" rescue nil
417 Dir.chdir "native" do
418 sh "zip ../runtime/compiler.rba **/*.rbc"
419 end
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
420 end
421 end
422
39b763c @evanphx Fixed the rake tasks for the compiler and added more ignores
evanphx authored
423 desc "Bootstrap and package the compiler"
424 task :compiler => ['build:compiler:bootstrap', 'build:compiler:package']
425
f83e9ee @brixen removed grammar.c from version control, added it to clean target. add…
brixen authored
426 desc "Builds shotgun, kernel, and bootstraps the compiler"
3897c94 * Support for Floats in Sprintf
Hurdlea authored
427 task :rubinius => ['build:shotgun', 'build:bootstrap', 'build:core', 'build:library', 'build:compiler']
e8b73c6 @wilson * Added build:delete_rbc task to clean up all rbc files, everywhere.
wilson authored
428
429 desc "Delete all cached .rbc files"
430 task :delete_rbc do
431 FileList['**/*.rbc', '*.rbc', '/tmp/*.rbc'].each do |fn|
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
432 FileUtils.rm fn rescue nil
433 end
434 end
435
436 desc "Delete all compiled ruby archives"
437 task :delete_rba do
438 FileList['runtime/*.rba'].each do |fn|
439 FileUtils.rm fn rescue nil
e8b73c6 @wilson * Added build:delete_rbc task to clean up all rbc files, everywhere.
wilson authored
440 end
441 end
baae928 big updates to reporting stuff
Mae authored
442 end
b7db3df Further fixes to the completeness report raking
Cabo authored
443
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
444 namespace :rbx do
445 desc "Clean build products and all compiled ruby files"
446 task :clean => ['build:clean', 'build:delete_rbc', 'build:delete_rba']
447
448 desc "Build all components that need it, but don't clean first"
449 task :build do
450 ::COMPILER = 'rbx -c'
a41ff7c bracket for Rake::Task not parens
Amarkj authored
451 Rake::Task['build:all'].invoke
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
452 end
453
454 desc "Rebuilds everything after clean"
455 task :rebuild => ['rbx:clean', 'rbx:build', 'build:bootstrap',
456 'build:core', 'build:library', 'build:compiler']
457
458 task :install => ['rbx:build', 'build:install']
459 end
460
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to elimi…
brixen authored
461 desc "Remove runtime/*.rba then svn up"
462 task :svn => 'svn:up'
463 namespace :svn do
464 desc "Remove runtime/*.rba then svn up"
465 task :up do
466 FileList['runtime/*.rba'].each do |f|
467 FileUtils.rm f
468 end
469 puts `svn up`
470
471 end
472 end
473
baae928 big updates to reporting stuff
Mae authored
474 task :report => 'report:all' # default
475 namespace :report do
b7db3df Further fixes to the completeness report raking
Cabo authored
476 desc "Build all reports"
4b4a582 fixed bug in Rakefile -- more fixes going into compare in a min
Mae authored
477 task :all => [:completeness, :rspec_errors]
baae928 big updates to reporting stuff
Mae authored
478
479 desc "Build completeness report"
a6682d1 added reports dir and also generated completeness.html to repo until …
Mae authored
480 task :completeness do
baae928 big updates to reporting stuff
Mae authored
481 run_report(:completeness)
482 end
483
ec5f703 created a report for tracking what is keeping shotgun from compiling …
Mae authored
484 desc "Build rspec errors report"
4b4a582 fixed bug in Rakefile -- more fixes going into compare in a min
Mae authored
485 task :rspec_errors do
2219843 added external: rspec 0.7.5 and added reporting for how broken it is
Mae authored
486 run_report(:rspec_errors)
487 end
488
ec5f703 created a report for tracking what is keeping shotgun from compiling …
Mae authored
489 desc "Build self-hosting errors report"
490 task :self_hosting_errors do
491 run_report(:self_hosting_errors)
492 end
493
baae928 big updates to reporting stuff
Mae authored
494 def run_report(name)
495 report = "#{ROOT}/bin/reports/#{name}.rb"
496 dest = "#{ROOT}/reports/#{name}.html"
497 File.open("#{ROOT}/reports/#{name}.html", 'w') do |f|
498 f.write `RUBYOPT='' ruby #{report}`
499 end
2219843 added external: rspec 0.7.5 and added reporting for how broken it is
Mae authored
500 puts "ruby #{report} > #{dest}"
baae928 big updates to reporting stuff
Mae authored
501 end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
502 end
503
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
504 desc "Run Ruby 1.9.x benchmark suite"
505 task :bm do
506 sh "rbx benchmark/run.rb"
507 end
508 desc "Run Ruby 1.9.x benchmark suite"
509 task :benchmark => :bm
510
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
511 namespace :doc do
512 desc "Learn how to contribute."
513 task :contrib => 'doc:contrib:easy'
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
514
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
515 namespace :contrib do
516 desc "Find out about easy ways to contribute."
517 task :easy do
518 puts <<-EOM
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
519
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
520 The Rubinius team welcomes contributions, bug reports, test cases, and monetary support.
521 One possible way to help is:
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
522 1. Visit the wiki at http://rubini.us
523 2. Read up on writing RSpec specs for Rubinius.
524 3. Read up on implementing the Ruby core library.
525 4. Check if a spec exists for the method you are adding.
526 5. Red, green, refactor.
527 6. Submit a nice diff to the mailing list: http://groups.google.com/group/rubinius-devel
528 7. When your patch is accepted, ask Evan for a commit bit.
529
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
530 The 'ri' command is a rich source of examples and test cases.
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
531
532 There are a lot of folks working, so pop into #rubinius channel on freenode and ask
533 questions. Try to follow the conventions in the code and restrain impulses to go
534 mad refactoring and reorganizing until you are well familiar with the code and have
535 asked other's opinions. In the words of the venerable cabo: 'Primum non nocere'
536
537 Thanks for helping to spread good will among all beings. Go on, start coding!
538
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
539 EOM
540 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
541
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
542 desc "Find out about ways to contribute that may require a lot of knowledge or work."
543 task :hard do
544 puts "More to come. For now, just make everything work faster than anything else in the world."
545 end
546 end
547 end
548
549 namespace :svk do
550 task :push do
551 sh 'svk push --verbatim'
552 end
553 end
554
555 # Deprecated rake tasks
556 def deprecate(msg)
557 puts "Deprecated. Please use #{msg}."
558 end
559
560 desc "DEPRECATED: Run shotgun's core tests"
561 task :test_shotgun do
562 deprecate 'test:shotgun'
563 Rake::Task['test:shotgun'].invoke
564 end
565
566 desc "DEPRECATED: Run all the tests"
567 task :test_all do
568 deprecate 'test:all'
569 Rake::Task['test:all'].invoke
570 end
6a03730 @evanphx Cleaned up some of the includes and fixed up the Rakefile to run the …
evanphx authored
571
572 # This forces ruby inline to build everything in the
573 # right place.
574 task :setup do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
575 deprecate 'build:setup'
576 Rake::Task['build:setup'].invoke
d4e9e90 @evanphx r93@vatu: evan | 2006-10-29 15:34:45 -0800
evanphx authored
577 end
578
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
579 desc "DEPRECATED: Build shotgun C components"
580 task :shotgun do
581 deprecate 'build:shotgun'
582 Rake::Task['build:shotgun'].invoke
f9924e3 @evanphx r53@vatu: evan | 2006-09-11 22:15:12 -0700
evanphx authored
583 end
584
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
585 desc "DEPRECATED: Prepare the code-cache directory"
bb76a4f @wilson Reorganized the Rakefile to make it easier to understand for first-ti…
wilson authored
586 task :code_cache do
c72dd91 Make rake code_cache point to the right task
Frederick authored
587 deprecate 'test:setup:code_cache'
588 Rake::Task['test:setup:code_cache'].invoke
bb76a4f @wilson Reorganized the Rakefile to make it easier to understand for first-ti…
wilson authored
589 end
6a03730 @evanphx Cleaned up some of the includes and fixed up the Rakefile to run the …
evanphx authored
590
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
591 desc "DEPRECATED: Ensure that the correct version of the sydparse gem is installed."
9107f2a @brixen Added ensure_syd task as dependency on build so that build will not c…
brixen authored
592 task :ensure_syd do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
593 deprecate 'build:setup:syd'
594 Rake::Task['build:setup:syd'].invoke
9107f2a @brixen Added ensure_syd task as dependency on build so that build will not c…
brixen authored
595 end
596
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
597 desc "DEPRECATED: Build syd-parser."
a38f811 @evanphx r55@vatu: evan | 2006-09-11 22:33:54 -0700
evanphx authored
598 task :syd do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
599 deprecate 'build:syd'
600 Rake::Task['build:syd'].invoke
a38f811 @evanphx r55@vatu: evan | 2006-09-11 22:33:54 -0700
evanphx authored
601 end
602
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
603 task :fields do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
604 deprecate 'build:fields'
605 Rake::Task['build:fields'].invoke
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
606 end
607
bb76a4f @wilson Reorganized the Rakefile to make it easier to understand for first-ti…
wilson authored
608 # Combine the separate .rb files in lib into a single kernel.rb
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
609 task :kernel do
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
610 deprecate 'build:setup:core'
611 Rake::Task['build:core'].invoke
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
612 end
613
bb76a4f @wilson Reorganized the Rakefile to make it easier to understand for first-ti…
wilson authored
614 # Build the kernel
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
615 task :bk do
2299586 @evanphx Cleaned up the rake file post reorg
evanphx authored
616 deprecate 'build:core'
617 Rake::Task['build:core'].invoke
cad84a5 @evanphx r69@vatu: evan | 2006-10-22 18:15:55 -0700
evanphx authored
618 end
619
1840a35 @brixen Added deprecated task br (e.g. invoke rake br) as an alias for build:…
brixen authored
620 # Build rubinius vm (i.e. shotgun, kernel, compiler bootstrap)
621 task :br do
622 deprecate 'build:rubinius'
623 Rake::Task['build:rubinius'].invoke
624 end
625
c3920f6 @evanphx r72@vatu: evan | 2006-10-24 18:31:21 -0700
evanphx authored
626 task :clean do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
627 deprecate 'build:clean'
628 Rake::Task['build:clean'].invoke
c3920f6 @evanphx r72@vatu: evan | 2006-10-24 18:31:21 -0700
evanphx authored
629 end
630
6ffbd6e @evanphx The start of the cuby primitives. cuby primitives are not yet integra…
evanphx authored
631 task :push do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
632 deprecate 'svk:push'
633 Rake::Task['svk:push'].invoke
6ffbd6e @evanphx The start of the cuby primitives. cuby primitives are not yet integra…
evanphx authored
634 end
635
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
636 desc "DEPRECATED: Alias for doc:contrib:easy."
73823df @brixen Added rake task to find low hanging fruit suggested by lypanov
brixen authored
637 task :find_low_hanging_fruit do
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
638 deprecate 'doc:contrib:easy'
639 Rake::Task['doc:contrib:easy'].invoke
73823df @brixen Added rake task to find low hanging fruit suggested by lypanov
brixen authored
640 end
641
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
642 # vim: syntax=ruby shiftwidth=2
Something went wrong with that request. Please try again.