Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 284 lines (234 sloc) 6.998 kb
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
1 require 'rake/legacy_tasks'
d630d96 Rakefile now supports rake report:all which runs all of the reports. All...
Ryantm authored
2 require 'rake/rubinius_spec_tasks'
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
3
d630d96 Rakefile now supports rake report:all which runs all of the reports. All...
Ryantm authored
4 task :default => :tasks
5
6 task :tasks do
7 puts `rake -T`
8 end
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
9
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
10 def newer?(file, cmp)
11 File.exists?(cmp) and File.mtime(cmp) >= File.mtime(file)
12 end
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
13
121d2bb @evanphx A little magic for a more bulletproof process. Run rake dev:setup after ...
evanphx authored
14 @pb = "runtime/pristine_bootstrap.rba"
15 @pc = "runtime/pristine_core.rba"
16
17 if File.exists?(@pb)
18 puts "Using #{@pb} for bootstrap."
19 ENV['BOOTSTRAP'] = @pb
20 end
21
22 if File.exists?(@pc)
23 puts "Using #{@pc} for core."
24 ENV['CORE'] = @pc
25 end
26
567d4f7 @evanphx Stack allocated lvars, GC fixes, compiler changes, oh my!
evanphx authored
27 @compiler = ENV['COMPILER']
28
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
29 def update_archive(files, archive, dir=nil)
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
30 archive = File.expand_path(ENV['OUTPUT'] || archive)
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to clear...
brixen authored
31
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
32 changed = []
33 files.each do |file|
34 cmp = "#{file}c"
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
35 if !newer?(file, cmp)
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
36 changed << cmp
567d4f7 @evanphx Stack allocated lvars, GC fixes, compiler changes, oh my!
evanphx authored
37 if @compiler
38 system "shotgun/rubinius -I#{@compiler} compile #{file}"
39 else
40 system "shotgun/rubinius compile #{file}"
41 end
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
42 elsif !File.exists?(archive)
43 changed << cmp
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
44 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
45 file << "c"
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to clear...
brixen authored
46 end
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
47
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
48 curdir = Dir.getwd
49 if dir
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
50 Dir.chdir(dir)
51 changed.map! { |f| f.gsub(%r!^#{dir}/!, "") }
cdfdc27 Added my idea of a sanity check against MRI for compatibility purposes
Mae authored
52 end
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
53
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
54 File.open(".load_order.txt","w") do |f|
55 f.puts files.join("\n")
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
56 end
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
57
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
58 if File.exists? archive
59 if changed.empty?
60 puts "No files to update."
61 else
62 system "zip -u #{archive} .load_order.txt #{changed.join(' ')}"
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
63 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
64 else
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
65 system "zip #{archive} .load_order.txt #{changed.join(' ')}"
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
66 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
67
68 Dir.chdir(curdir) if dir
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
69 end
70
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
71 # spec tasks
03dfae6 @brixen Added rake task spec:ci. added svn:executable for bin/mspec. enhanced re...
brixen authored
72 namespace :spec do
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
73 namespace :setup do
74 desc "Setup for subtend examples"
75 task :subtend do
76 Dir[File.join(ROOT,"spec/subtend/**/Rakefile")].each do |rakefile|
77 sh "rake -f #{rakefile}"
78 end
79 end
80 end
81
82 desc "Run continuous integration examples"
03dfae6 @brixen Added rake task spec:ci. added svn:executable for bin/mspec. enhanced re...
brixen authored
83 task :ci do
84 begin
85 stat = File.stat("CI-specs")
86 if stat.file?
87 raise "CI-specs is a file. Remove it to run CI specs"
88 elsif stat.directory?
89 sh "svn up CI-specs"
90 end
91 rescue
92 sh("svn co http://code.fallingsnow.net/svn/rubinius/branches/CI-specs")
93 end
c7d623e @brixen enhanced spec:ci to take a target on the command line, invoke like: SPEC...
brixen authored
94 target = ENV['SPEC_TARGET'] || 'rbx'
95 system %(shotgun/rubinius -e 'puts "rbx build: \#{Rubinius::BUILDREV}"') if target == 'rbx'
96 sh "bin/mspec -t #{target} -f ci CI-specs"
03dfae6 @brixen Added rake task spec:ci. added svn:executable for bin/mspec. enhanced re...
brixen authored
97 end
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
98
99 spec_targets = %w(compiler core incompatible language library parser rubinius)
100 # Build a spec:<task_name> for each group of Rubinius specs
101 spec_targets.each do |group|
102 desc "Run #{group} examples"
d08e789 @brixen fixed typo. bad typo. that's a no.
brixen authored
103 task group do
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
104 sh "bin/mspec spec/#{group}"
105 end
106 end
107
108 desc "Run subtend examples"
109 task :subtend => "spec:setup:subtend" do
110 sh "bin/mspec spec/subtend"
111 end
112
113 # Specdiffs to make it easier to see what your changes have affected :)
114 desc 'Run specs and produce a diff against current base'
115 task :diff => 'diff:run'
116
117 namespace :diff do
118 desc 'Run specs and produce a diff against current base'
119 task :run do
120 system 'bin/mspec spec > /tmp/rbs_specdiff'
121 system 'diff -u spec/diffs/base.txt /tmp/rbs_specdiff'
122 system 'rm /tmp/rbs_specdiff'
123 end
124
125 desc 'Replace the base spec file with a new one'
126 task :replace do
127 system 'bin/mspec spec > spec/diffs/base.txt'
128 end
129 end
d630d96 Rakefile now supports rake report:all which runs all of the reports. All...
Ryantm authored
130
131 task :r2r do
132 puts ARGV.inspect
133 end
03dfae6 @brixen Added rake task spec:ci. added svn:executable for bin/mspec. enhanced re...
brixen authored
134 end
135
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
136 # build tasks
137 desc "Completely rebuild everything"
138 task :rebuild => ['build:clean', 'build:shotgun', 'build:compiler', 'build:bootstrap', 'build:core', 'build:library']
139
140 desc "Build shotgun (the C-code VM)"
141 task :build => ['build:shotgun']
142
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
143 namespace :build do
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
144
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
145 desc "Removes build by-products for shotgun, compiler, and library"
146 task :clean => ['clean:shotgun', 'clean:compiler', 'clean:bootstrap', 'clean:core', 'clean:library']
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
147
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
148 namespace :clean do
149 desc "Removes build by-products for shotgun"
150 task :shotgun do
685576c Ticket #80: Respect environment variables that influence the build proce...
Tilman authored
151 sh "make -C shotgun clean || true"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead of ...
brixen authored
152 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
153
154 desc "Removes build by-products for compiler"
155 task :compiler do
156 FileList['native/**/*.rbc', '/tmp/*.rbc'].each do |fn|
157 FileUtils.rm fn rescue nil
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
158 end
159 end
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
160
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
161 desc "Removes build by-products for library"
162 task :library do
163 FileList['library/**/*.rbc'].each do |fn|
164 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba ha...
evanphx authored
165 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
166 end
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba ha...
evanphx authored
167
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
168 desc "Removes build by-products for bootstrap"
169 task :bootstrap do
170 FileList['kernel/bootstrap/**/*.rbc'].each do |fn|
171 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba ha...
evanphx authored
172 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
173 end
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba ha...
evanphx authored
174
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
175 desc "Removes build by-products for core"
176 task :core do
177 FileList['kernel/core/**/*.rbc'].each do |fn|
178 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba ha...
evanphx authored
179 end
180 end
181 end
404f8ab Don't call configure on build:shotgun everytime.
Tilman authored
182
183 file "shotgun/config.h" do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
184 sh "./configure"
185 raise 'Failed to configure Rubinius' unless $?.success?
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like bootstr...
evanphx authored
186 end
187
404f8ab Don't call configure on build:shotgun everytime.
Tilman authored
188 task :configure => ["shotgun/config.h"] do
189 end
190
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
191 desc "Compiles shotgun (the C-code VM)"
192 task :shotgun => :configure do
685576c Ticket #80: Respect environment variables that influence the build proce...
Tilman authored
193 sh "make"
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
194 raise 'Failed to build shotgun' unless $?.success?
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
195 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
196
197 desc "Compiles the Rubinius bootstrap archive"
198 task :bootstrap do
199 files = Dir["kernel/bootstrap/*.rb"].sort
200 update_archive files, 'runtime/bootstrap.rba'
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead of ...
brixen authored
201 end
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
202
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
203 desc "Compiles the Rubinius core archive"
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like bootstr...
evanphx authored
204 task :core do
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
205 files = Dir["kernel/core/*.rb"].sort
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
206 update_archive files, 'runtime/core.rba'
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
207 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
208
6001be6 @evanphx loader.rb is now seperated from bootstrap and core.
evanphx authored
209 task :loader do
210 i = "kernel/loader.rb"
211 o = "runtime/loader.rbc"
212
213 if @compiler
214 system "shotgun/rubinius -I#{@compiler} compile #{i} #{o}"
215 else
216 system "shotgun/rubinius compile #{i} #{o}"
217 end
218 end
219
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
220 desc "Compiles the Rubinius library archive"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead of ...
brixen authored
221 task :library do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
222 files = Dir["library/**/*.rb"].sort
223 update_archive files, 'runtime/library.rba'
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
224 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilation ...
brixen authored
225
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
226 desc "Compiles the Rubinius compiler archive"
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like bootstr...
evanphx authored
227 task :compiler do
228 files = %w! bytecode/compiler bytecode/assembler bytecode/encoder
229 sexp/simple_processor translation/normalize translation/local_scoping
230 sexp/composite_processor translation/states sexp/exceptions
231 bytecode/primitive_names !
ca67813 @evanphx WOO! This commit marks the beginning of the self hosting era!
evanphx authored
232
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like bootstr...
evanphx authored
233 paths = []
234
235 files.each do |name|
236 file = "#{name}.rb"
237 dir = File.dirname(file)
238 dest_dir = File.join("native", dir)
239 path = File.expand_path File.join("lib", file)
240 dest = File.join("native", file)
241 FileUtils.mkdir_p dest_dir
242 FileUtils.symlink path, dest rescue nil
243
244 paths << dest
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
245 end
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like bootstr...
evanphx authored
246
567d4f7 @evanphx Stack allocated lvars, GC fixes, compiler changes, oh my!
evanphx authored
247 paths += %w!native/bytecode/rubinius.rb
248 native/bytecode/system_hints.rb
249 native/bytecode/plugins.rb!
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
250
251 update_archive paths, 'runtime/compiler.rba', "native"
e8b73c6 @wilson * Added build:delete_rbc task to clean up all rbc files, everywhere.
wilson authored
252 end
baae928 big updates to reporting stuff
Mae authored
253 end
b7db3df Further fixes to the completeness report raking
Cabo authored
254
9e24421 @wilson * Use a random pivot point for better worst-case Array#sort performance
wilson authored
255 desc "Remove all .rbc files from the project"
256 task :pristine do
257 FileList['**/*.rbc'].each do |fn|
258 FileUtils.rm fn rescue nil
259 end
260 end
261
6e51eee @brixen put guards on imcompatible specs to prevent ruby, jruby from running the...
brixen authored
262 # svn tasks
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to eliminat...
brixen authored
263 desc "Remove runtime/*.rba then svn up"
264 task :svn => 'svn:up'
265 namespace :svn do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
266 desc "Revert runtime/*.rba then svn up"
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to eliminat...
brixen authored
267 task :up do
d630d96 Rakefile now supports rake report:all which runs all of the reports. All...
Ryantm authored
268 sh "svn revert reports/*.html"
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in the...
wilson authored
269 sh "svn revert runtime/*.rba"
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to eliminat...
brixen authored
270 puts `svn up`
baae928 big updates to reporting stuff
Mae authored
271 end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
272 end
273
121d2bb @evanphx A little magic for a more bulletproof process. Run rake dev:setup after ...
evanphx authored
274 # dev tasks
275
276 namespace :dev do
277 desc "Make a few changes to support easier development"
278 task :setup do
279 sh "cp runtime/core.rba #{@pc}"
280 sh "cp runtime/bootstrap.rba #{@pb}"
281 end
282 end
283
Something went wrong with that request. Please try again.