Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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