Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 184 lines (152 sloc) 4.637 kB
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
1 require 'rake/rubinius_spec_tasks'
2 require 'rake/legacy_tasks'
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
3 task :default => :spec
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
4
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
5 def newer?(file, cmp)
6 File.exists?(cmp) and File.mtime(cmp) >= File.mtime(file)
7 end
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
8
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
9 def update_archive(files, archive, dir=nil)
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
10 archive = File.expand_path(ENV['OUTPUT'] || archive)
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
11
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
12 changed = []
13 files.each do |file|
14 cmp = "#{file}c"
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
15 if !newer?(file, cmp)
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
16 changed << cmp
17 system "shotgun/rubinius compile #{file}"
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
18 elsif !File.exists?(archive)
19 changed << cmp
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
20 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
21 file << "c"
e1683f8 @brixen updated rake task doc:contrib:easy. Added spec:setup:code_cache to cl…
brixen authored
22 end
6b9c27b Complete rspec coverage of subtend string compat to date.
Kev authored
23
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
24 curdir = Dir.getwd
25 if dir
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
26 Dir.chdir(dir)
27 changed.map! { |f| f.gsub(%r!^#{dir}/!, "") }
cdfdc27 Added my idea of a sanity check against MRI for compatibility purposes
Mae authored
28 end
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
29
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
30 File.open(".load_order.txt","w") do |f|
31 f.puts files.join("\n")
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
32 end
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
33
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
34 if File.exists? archive
35 if changed.empty?
36 puts "No files to update."
37 else
38 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
39 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
40 else
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
41 system "zip #{archive} .load_order.txt #{changed.join(' ')}"
086f889 * bin/specrunner is a small bash kludge for running mini_rspec over
Eero Saynatkari authored
42 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
43
44 Dir.chdir(curdir) if dir
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
45 end
46
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
47 desc "Completely rebuild everything"
48 task :rebuild => ['build:clean', 'build:shotgun', 'build:compiler', 'build:bootstrap', 'build:core', 'build:library']
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
49
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
50 desc "Build shotgun (the C-code VM)"
51 task :build => ['build:shotgun']
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
52
03dfae6 @brixen Added rake task spec:ci. added svn:executable for bin/mspec. enhanced…
brixen authored
53 namespace :spec do
54 task :ci do
55 begin
56 stat = File.stat("CI-specs")
57 if stat.file?
58 raise "CI-specs is a file. Remove it to run CI specs"
59 elsif stat.directory?
60 sh "svn up CI-specs"
61 end
62 rescue
63 sh("svn co http://code.fallingsnow.net/svn/rubinius/branches/CI-specs")
64 end
65 sh "bin/mspec CI-specs"
66 end
67 end
68
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
69 namespace :build do
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
70
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
71 desc "Removes build by-products for shotgun, compiler, and library"
72 task :clean => ['clean:shotgun', 'clean:compiler', 'clean:bootstrap', 'clean:core', 'clean:library']
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
73
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
74 namespace :clean do
75 desc "Removes build by-products for shotgun"
76 task :shotgun do
685576c Ticket #80: Respect environment variables that influence the build pr…
Tilman authored
77 sh "make -C shotgun clean || true"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
78 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
79
80 desc "Removes build by-products for compiler"
81 task :compiler do
82 FileList['native/**/*.rbc', '/tmp/*.rbc'].each do |fn|
83 FileUtils.rm fn rescue nil
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
84 end
85 end
fbba2c6 @evanphx Fixed rakefile so that kernel/hints and 00auto_fields.rb are regenerated
evanphx authored
86
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
87 desc "Removes build by-products for library"
88 task :library do
89 FileList['library/**/*.rbc'].each do |fn|
90 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
91 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
92 end
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
93
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
94 desc "Removes build by-products for bootstrap"
95 task :bootstrap do
96 FileList['kernel/bootstrap/**/*.rbc'].each do |fn|
97 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
98 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
99 end
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
100
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
101 desc "Removes build by-products for core"
102 task :core do
103 FileList['kernel/core/**/*.rbc'].each do |fn|
104 FileUtils.rm fn rescue nil
5468980 @evanphx kernel/ reorg! New functionality goes in kernel/core only. kernel.rba…
evanphx authored
105 end
106 end
107 end
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
108
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
109 task :configure do
110 sh "./configure"
111 raise 'Failed to configure Rubinius' unless $?.success?
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
112 end
113
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
114 desc "Compiles shotgun (the C-code VM)"
115 task :shotgun => :configure do
685576c Ticket #80: Respect environment variables that influence the build pr…
Tilman authored
116 sh "make"
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
117 raise 'Failed to build shotgun' unless $?.success?
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
118 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
119
120 desc "Compiles the Rubinius bootstrap archive"
121 task :bootstrap do
122 files = Dir["kernel/bootstrap/*.rb"].sort
123 update_archive files, 'runtime/bootstrap.rba'
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
124 end
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
125
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
126 desc "Compiles the Rubinius core archive"
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
127 task :core do
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
128 files = Dir["kernel/core/*.rb"].sort
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
129 files.delete("kernel/core/__loader.rb")
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
130 files << "kernel/core/__loader.rb"
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
131 update_archive files, 'runtime/core.rba'
34ad791 * Disabled Lightning's dissembler on amd64
Eero Saynatkari authored
132 end
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
133
134 desc "Compiles the Rubinius library archive"
9463145 @brixen Updates to Rakefile, added rbx namespace to compile with rbx instead …
brixen authored
135 task :library do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
136 files = Dir["library/**/*.rb"].sort
137 update_archive files, 'runtime/library.rba'
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
138 end
2ff0f11 @brixen added Andrew Thompson's Rakefile patches to catch errors in compilati…
brixen authored
139
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
140 desc "Compiles the Rubinius compiler archive"
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
141 task :compiler do
142 files = %w! bytecode/compiler bytecode/assembler bytecode/encoder
143 sexp/simple_processor translation/normalize translation/local_scoping
144 sexp/composite_processor translation/states sexp/exceptions
145 bytecode/primitive_names !
ca67813 @evanphx WOO! This commit marks the beginning of the self hosting era!
evanphx authored
146
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
147 paths = []
148
149 files.each do |name|
150 file = "#{name}.rb"
151 dir = File.dirname(file)
152 dest_dir = File.join("native", dir)
153 path = File.expand_path File.join("lib", file)
154 dest = File.join("native", file)
155 FileUtils.mkdir_p dest_dir
156 FileUtils.symlink path, dest rescue nil
157
158 paths << dest
dd4b574 @evanphx Merge from /branches/backtrace.
evanphx authored
159 end
3751f33 @evanphx * Reworked the Rakefile to build the compiler by detection, like boot…
evanphx authored
160
161 paths += %w!native/bytecode/rubinius.rb native/bytecode/system_hints.rb!
939f9ac @evanphx Revert array changes back to r1088. r1089 is busted bigtime.
evanphx authored
162
163 update_archive paths, 'runtime/compiler.rba', "native"
e8b73c6 @wilson * Added build:delete_rbc task to clean up all rbc files, everywhere.
wilson authored
164 end
baae928 big updates to reporting stuff
Mae authored
165 end
b7db3df Further fixes to the completeness report raking
Cabo authored
166
9e24421 @wilson * Use a random pivot point for better worst-case Array#sort performance
wilson authored
167 desc "Remove all .rbc files from the project"
168 task :pristine do
169 FileList['**/*.rbc'].each do |fn|
170 FileUtils.rm fn rescue nil
171 end
172 end
173
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to elimi…
brixen authored
174 desc "Remove runtime/*.rba then svn up"
175 task :svn => 'svn:up'
176 namespace :svn do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
177 desc "Revert runtime/*.rba then svn up"
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to elimi…
brixen authored
178 task :up do
dc16b49 @wilson * Near-total rewrite of the Rakefile. Tasks that use rcompile are in …
wilson authored
179 sh "svn revert runtime/*.rba"
3e5e566 @brixen Added svn => svn:up which remove runtime/*.rba before svn up to elimi…
brixen authored
180 puts `svn up`
baae928 big updates to reporting stuff
Mae authored
181 end
4d4f6fa @brixen Added namespaces to the Rakefile with aliases to the old tasks.
brixen authored
182 end
183
Something went wrong with that request. Please try again.