rake-compiler 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +36 -11
- data/lib/rake/extensioncompiler.rb +53 -0
- data/lib/rake/extensiontask.rb +44 -13
- data/spec/lib/rake/extensiontask_spec.rb +45 -18
- data/tasks/bin/cross-ruby.rake +27 -22
- data/tasks/cucumber.rake +2 -1
- data/tasks/gem.rake +1 -1
- data/tasks/rspec.rake +10 -9
- metadata +4 -3
data/History.txt
CHANGED
@@ -1,45 +1,70 @@
|
|
1
|
-
|
1
|
+
== 0.4.0 2009-04-03
|
2
2
|
|
3
|
-
|
3
|
+
=== Enhancements
|
4
|
+
|
5
|
+
* Bended the convention for extension folder.
|
6
|
+
Defining <tt>ext_dir</tt> for custom extension location.
|
7
|
+
|
8
|
+
Rake::ExtensionTask.new('my_extension') do |ext|
|
9
|
+
ext.ext_dir = 'custom/location' # look into custom/location
|
10
|
+
end # instead of ext/my_extension
|
11
|
+
|
12
|
+
* Better detection of mingw target across Linux/OSX.
|
13
|
+
Exposed it as Rake::ExtensionCompiler
|
14
|
+
|
15
|
+
* Display list of available tasks when calling rake-compiler script
|
16
|
+
|
17
|
+
* Track Ruby full versioning (x.y.z).
|
18
|
+
This will help the compilation of extensions targetting 1.8.6/7 and 1.9.1
|
19
|
+
|
20
|
+
=== Bugfixes
|
21
|
+
|
22
|
+
* Better output of Rake development tasks (Thanks to Luis Parravicini).
|
23
|
+
* Proper usage of Gem::Platform for native gems (Thanks to Dirkjan Bussink).
|
24
|
+
* Don't use autoload for YAML (present problems with Ruby 1.9.1).
|
25
|
+
|
26
|
+
== 0.3.1 / 2009-01-09
|
27
|
+
|
28
|
+
=== Enhancements
|
4
29
|
|
5
30
|
* Download cross-ruby source code using HTTP instead of FTP.
|
6
31
|
* Disabled Tcl/Tk extension building on cross-ruby (helps with 1.9).
|
7
32
|
|
8
|
-
|
33
|
+
=== Bugfixes
|
9
34
|
|
10
35
|
* Workaround bug introduced by lack of Gem::Specification cloning. Fixes DM LH #757.
|
11
36
|
* Use proper binary extension on OSX (reported by Dirkjan Bussink).
|
12
37
|
* Ensure lib/binary task is defined prior clear of requisites.
|
13
38
|
|
14
|
-
|
39
|
+
== 0.3.0 / 2008-12-07
|
15
40
|
|
16
|
-
|
41
|
+
=== New features
|
17
42
|
|
18
43
|
* Let you specify the Ruby version used for cross compilation instead
|
19
44
|
of default one.
|
20
45
|
|
21
46
|
rake cross compile RUBY_CC_VERSION=1.8
|
22
47
|
|
23
|
-
|
48
|
+
=== Enhancements
|
24
49
|
|
25
50
|
* Properly update rake-compiler configuration when new version is installed.
|
26
51
|
* Automated release process to RubyForge, yay!
|
27
52
|
|
28
|
-
|
53
|
+
=== Bugfixes
|
29
54
|
|
30
55
|
* Corrected documentation to reflect the available options
|
31
56
|
|
32
|
-
|
57
|
+
== 0.2.1 / 2008-11-30
|
33
58
|
|
34
|
-
|
59
|
+
=== New features
|
35
60
|
|
36
61
|
* Allow cross compilation (cross compile) using mingw32 on Linux or OSX.
|
37
62
|
* Allow packaging of gems for Windows on Linux or OSX.
|
38
63
|
|
39
|
-
|
64
|
+
=== Enhancements
|
40
65
|
|
41
66
|
* Made generation of extensions safe and target folders per-platform
|
42
67
|
|
43
|
-
|
68
|
+
=== Bugfixes
|
44
69
|
|
45
70
|
* Ensure binaries for the specific platform are copied before packaging.
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
#
|
4
|
+
# HACK: Lousy API design, sue me. At least works ;-)
|
5
|
+
#
|
6
|
+
# Define a series of helpers to aid in search and usage of MinGW (GCC) Compiler
|
7
|
+
# by gem developer/creators.
|
8
|
+
#
|
9
|
+
|
10
|
+
module Rake
|
11
|
+
module ExtensionCompiler
|
12
|
+
# return the host portion from the installed MinGW
|
13
|
+
def self.mingw_host
|
14
|
+
return @mingw_host if @mingw_host
|
15
|
+
|
16
|
+
# the mingw_gcc_executable is helpful here
|
17
|
+
if target = mingw_gcc_executable then
|
18
|
+
# we only care for the filename
|
19
|
+
target = File.basename(target)
|
20
|
+
|
21
|
+
# now strip the extension (if present)
|
22
|
+
target.sub!(File.extname(target), '')
|
23
|
+
|
24
|
+
# get rid of '-gcc' portion too ;-)
|
25
|
+
target.sub!('-gcc', '')
|
26
|
+
end
|
27
|
+
|
28
|
+
raise "No MinGW tools or unknown setup platform?" unless target
|
29
|
+
|
30
|
+
@mingw_host = target
|
31
|
+
end
|
32
|
+
|
33
|
+
# return the first compiler found that includes both mingw and gcc conditions
|
34
|
+
# (this assumes you have one installed)
|
35
|
+
def self.mingw_gcc_executable
|
36
|
+
return @mingw_gcc_executable if @mingw_gcc_executable
|
37
|
+
|
38
|
+
# grab the paths defined in the environment
|
39
|
+
paths = ENV['PATH'].split(File::PATH_SEPARATOR)
|
40
|
+
|
41
|
+
# the pattern to look into (captures *nix and windows executables)
|
42
|
+
pattern = "*mingw*gcc{,.*}"
|
43
|
+
|
44
|
+
@mingw_gcc_executable = paths.find do |path|
|
45
|
+
# cleanup paths before globbing
|
46
|
+
gcc = Dir.glob("#{File.expand_path(path)}/#{pattern}").first
|
47
|
+
break gcc if gcc
|
48
|
+
end
|
49
|
+
|
50
|
+
@mingw_gcc_executable
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
data/lib/rake/extensiontask.rb
CHANGED
@@ -7,10 +7,10 @@ require 'rake'
|
|
7
7
|
require 'rake/clean'
|
8
8
|
require 'rake/tasklib'
|
9
9
|
require 'rbconfig'
|
10
|
+
require 'yaml'
|
10
11
|
|
11
12
|
module Rake
|
12
13
|
autoload :GemPackageTask, 'rake/gempackagetask'
|
13
|
-
autoload :YAML, 'yaml'
|
14
14
|
|
15
15
|
class ExtensionTask < TaskLib
|
16
16
|
attr_accessor :name
|
@@ -37,7 +37,7 @@ module Rake
|
|
37
37
|
@gem_spec = gem_spec
|
38
38
|
@config_script = 'extconf.rb'
|
39
39
|
@tmp_dir = 'tmp'
|
40
|
-
@ext_dir =
|
40
|
+
@ext_dir = "ext/#{@name}"
|
41
41
|
@lib_dir = 'lib'
|
42
42
|
@source_pattern = "*.c"
|
43
43
|
@config_options = []
|
@@ -102,17 +102,30 @@ module Rake
|
|
102
102
|
file "#{tmp_path}/Makefile" => [tmp_path, extconf] do |t|
|
103
103
|
options = @config_options.dup
|
104
104
|
|
105
|
+
# include current directory
|
106
|
+
cmd = ['-I.']
|
107
|
+
|
108
|
+
# if fake.rb is present, add to the command line
|
109
|
+
if t.prerequisites.include?("#{tmp_path}/fake.rb") then
|
110
|
+
cmd << '-rfake'
|
111
|
+
end
|
112
|
+
|
113
|
+
# now add the extconf script
|
114
|
+
cmd << File.join(Dir.pwd, extconf)
|
115
|
+
|
105
116
|
# rbconfig.rb will be present if we are cross compiling
|
106
117
|
if t.prerequisites.include?("#{tmp_path}/rbconfig.rb") then
|
107
118
|
options.push(*@cross_config_options)
|
108
119
|
end
|
109
120
|
|
110
|
-
|
121
|
+
# add options to command
|
122
|
+
cmd.push(*options)
|
123
|
+
|
111
124
|
chdir tmp_path do
|
112
125
|
# FIXME: Rake is broken for multiple arguments system() calls.
|
113
126
|
# Add current directory to the search path of Ruby
|
114
127
|
# Also, include additional parameters supplied.
|
115
|
-
ruby
|
128
|
+
ruby cmd.join(' ')
|
116
129
|
end
|
117
130
|
end
|
118
131
|
|
@@ -128,7 +141,7 @@ module Rake
|
|
128
141
|
task "compile:#{@name}"
|
129
142
|
end
|
130
143
|
|
131
|
-
# Allow segmented compilation by
|
144
|
+
# Allow segmented compilation by platform (open door for 'cross compile')
|
132
145
|
task "compile:#{@name}:#{platf}" => ["copy:#{@name}:#{platf}"]
|
133
146
|
task "compile:#{platf}" => ["compile:#{@name}:#{platf}"]
|
134
147
|
|
@@ -157,7 +170,7 @@ module Rake
|
|
157
170
|
spec = Gem::Specification.from_yaml(gem_spec.to_yaml)
|
158
171
|
|
159
172
|
# adjust to specified platform
|
160
|
-
spec.platform = platf
|
173
|
+
spec.platform = Gem::Platform.new(platf)
|
161
174
|
|
162
175
|
# clear the extensions defined in the specs
|
163
176
|
spec.extensions.clear
|
@@ -202,7 +215,7 @@ module Rake
|
|
202
215
|
|
203
216
|
def define_cross_platform_tasks
|
204
217
|
config_path = File.expand_path("~/.rake-compiler/config.yml")
|
205
|
-
|
218
|
+
ruby_ver = ENV['RUBY_CC_VERSION'] || RUBY_VERSION
|
206
219
|
|
207
220
|
# warn the user about the need of configuration to use cross compilation.
|
208
221
|
unless File.exist?(config_path)
|
@@ -215,21 +228,28 @@ module Rake
|
|
215
228
|
# tmp_path
|
216
229
|
tmp_path = "#{@tmp_dir}/#{cross_platform}/#{@name}"
|
217
230
|
|
218
|
-
unless rbconfig_file = config_file["rbconfig-#{
|
219
|
-
fail "no configuration section for
|
231
|
+
unless rbconfig_file = config_file["rbconfig-#{ruby_ver}"] then
|
232
|
+
fail "no configuration section for specified version of Ruby (rbconfig-#{ruby_ver})"
|
220
233
|
end
|
221
234
|
|
222
235
|
# define compilation tasks for cross platfrom!
|
223
236
|
define_compile_tasks(cross_platform)
|
224
237
|
|
225
|
-
# chain rbconfig.rb to Makefile generation
|
226
|
-
file "#{tmp_path}/Makefile" => ["#{tmp_path}/rbconfig.rb"]
|
238
|
+
# chain fake.rb and rbconfig.rb to Makefile generation
|
239
|
+
file "#{tmp_path}/Makefile" => ["#{tmp_path}/fake.rb", "#{tmp_path}/rbconfig.rb"]
|
227
240
|
|
228
241
|
# copy the file from the cross-ruby location
|
229
242
|
file "#{tmp_path}/rbconfig.rb" => [rbconfig_file] do |t|
|
230
243
|
cp t.prerequisites.first, t.name
|
231
244
|
end
|
232
245
|
|
246
|
+
# genearte fake.rb for different ruby versions
|
247
|
+
file "#{tmp_path}/fake.rb" do |t|
|
248
|
+
File.open(t.name, 'w') do |f|
|
249
|
+
f.write fake_rb(ruby_ver)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
233
253
|
# now define native tasks for cross compiled files
|
234
254
|
define_native_tasks(cross_platform) if @gem_spec && @gem_spec.platform == 'ruby'
|
235
255
|
|
@@ -257,7 +277,7 @@ module Rake
|
|
257
277
|
end
|
258
278
|
|
259
279
|
def extconf
|
260
|
-
"#{@ext_dir}/#{@
|
280
|
+
"#{@ext_dir}/#{@config_script}"
|
261
281
|
end
|
262
282
|
|
263
283
|
def make
|
@@ -277,7 +297,18 @@ module Rake
|
|
277
297
|
end
|
278
298
|
|
279
299
|
def source_files
|
280
|
-
@source_files ||= FileList["#{@ext_dir}/#{@
|
300
|
+
@source_files ||= FileList["#{@ext_dir}/#{@source_pattern}"]
|
301
|
+
end
|
302
|
+
|
303
|
+
def fake_rb(version)
|
304
|
+
<<-FAKE_RB
|
305
|
+
class Object
|
306
|
+
remove_const :RUBY_PLATFORM
|
307
|
+
remove_const :RUBY_VERSION
|
308
|
+
RUBY_PLATFORM = "i386-mingw32"
|
309
|
+
RUBY_VERSION = "#{version}"
|
310
|
+
end
|
311
|
+
FAKE_RB
|
281
312
|
end
|
282
313
|
end
|
283
314
|
end
|
@@ -68,10 +68,6 @@ describe Rake::ExtensionTask do
|
|
68
68
|
@ext.tmp_dir.should == 'tmp'
|
69
69
|
end
|
70
70
|
|
71
|
-
it 'should look for extension inside ext/' do
|
72
|
-
@ext.ext_dir.should == 'ext'
|
73
|
-
end
|
74
|
-
|
75
71
|
it 'should copy build extension into lib/' do
|
76
72
|
@ext.lib_dir.should == 'lib'
|
77
73
|
end
|
@@ -195,6 +191,23 @@ describe Rake::ExtensionTask do
|
|
195
191
|
end
|
196
192
|
end
|
197
193
|
|
194
|
+
describe '(extension in custom location)' do
|
195
|
+
before :each do
|
196
|
+
Rake::FileList.stub!(:[]).and_return(["ext/extension_one/source.c"])
|
197
|
+
@ext = Rake::ExtensionTask.new('extension_one') do |ext|
|
198
|
+
ext.ext_dir = 'custom/ext/foo'
|
199
|
+
end
|
200
|
+
@ext_bin = ext_bin('extension_one')
|
201
|
+
@platform = RUBY_PLATFORM
|
202
|
+
end
|
203
|
+
|
204
|
+
describe 'tmp/{platform}/extension_one/Makefile' do
|
205
|
+
it "should depend on 'custom/ext/foo/extconf.rb'" do
|
206
|
+
Rake::Task["tmp/#{@platform}/extension_one/Makefile"].prerequisites.should include("custom/ext/foo/extconf.rb")
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
198
211
|
describe '(native tasks)' do
|
199
212
|
before :each do
|
200
213
|
Rake::FileList.stub!(:[]).and_return(["ext/extension_one/source.c"])
|
@@ -246,8 +259,10 @@ describe Rake::ExtensionTask do
|
|
246
259
|
Rake::FileList.stub!(:[]).and_return(["ext/extension_one/source.c"])
|
247
260
|
@spec = mock_gem_spec
|
248
261
|
@config_file = File.expand_path("~/.rake-compiler/config.yml")
|
249
|
-
@
|
250
|
-
@config_path = mock_config_yml["rbconfig-#{@
|
262
|
+
@ruby_ver = RUBY_VERSION
|
263
|
+
@config_path = mock_config_yml["rbconfig-#{@ruby_ver}"]
|
264
|
+
|
265
|
+
File.stub!(:open).and_yield(mock_fake_rb)
|
251
266
|
end
|
252
267
|
|
253
268
|
it 'should not generate an error if no rake-compiler configuration exist' do
|
@@ -268,29 +283,30 @@ describe Rake::ExtensionTask do
|
|
268
283
|
|
269
284
|
it 'should fail if no section of config file defines running version of ruby' do
|
270
285
|
config = mock(Hash)
|
271
|
-
config.should_receive(:[]).with("rbconfig-#{@
|
286
|
+
config.should_receive(:[]).with("rbconfig-#{@ruby_ver}").and_return(nil)
|
272
287
|
YAML.stub!(:load_file).and_return(config)
|
273
288
|
lambda {
|
274
289
|
Rake::ExtensionTask.new('extension_one') do |ext|
|
275
290
|
ext.cross_compile = true
|
276
291
|
end
|
277
|
-
}.should raise_error(RuntimeError, /no configuration section for
|
292
|
+
}.should raise_error(RuntimeError, /no configuration section for specified version of Ruby/)
|
278
293
|
end
|
279
294
|
|
280
295
|
it 'should allow usage of RUBY_CC_VERSION to indicate a different version of ruby' do
|
281
296
|
config = mock(Hash)
|
282
|
-
config.should_receive(:[]).with("rbconfig-
|
297
|
+
config.should_receive(:[]).with("rbconfig-1.9.1").and_return('/path/to/ruby/1.9.1/rbconfig.rb')
|
283
298
|
YAML.stub!(:load_file).and_return(config)
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
end
|
289
|
-
ensure
|
290
|
-
ENV.delete('RUBY_CC_VERSION')
|
299
|
+
|
300
|
+
ENV['RUBY_CC_VERSION'] = '1.9.1'
|
301
|
+
Rake::ExtensionTask.new('extension_one') do |ext|
|
302
|
+
ext.cross_compile = true
|
291
303
|
end
|
292
304
|
end
|
293
305
|
|
306
|
+
after :each do
|
307
|
+
ENV.delete('RUBY_CC_VERSION')
|
308
|
+
end
|
309
|
+
|
294
310
|
describe "(cross for 'universal-unknown' platform)" do
|
295
311
|
before :each do
|
296
312
|
@ext = Rake::ExtensionTask.new('extension_one', @spec) do |ext|
|
@@ -299,6 +315,12 @@ describe Rake::ExtensionTask do
|
|
299
315
|
end
|
300
316
|
end
|
301
317
|
|
318
|
+
describe 'fake' do
|
319
|
+
it 'should chain fake task to Makefile generation' do
|
320
|
+
Rake::Task['tmp/universal-unknown/extension_one/Makefile'].prerequisites.should include('tmp/universal-unknown/extension_one/fake.rb')
|
321
|
+
end
|
322
|
+
end
|
323
|
+
|
302
324
|
describe 'rbconfig' do
|
303
325
|
it 'should chain rbconfig tasks to Makefile generation' do
|
304
326
|
Rake::Task['tmp/universal-unknown/extension_one/Makefile'].prerequisites.should include('tmp/universal-unknown/extension_one/rbconfig.rb')
|
@@ -345,8 +367,13 @@ describe Rake::ExtensionTask do
|
|
345
367
|
|
346
368
|
def mock_config_yml
|
347
369
|
{
|
348
|
-
'rbconfig-1.8' => '/some/path/version/1.8/to/rbconfig.rb',
|
349
|
-
'rbconfig-1.9' => '/some/path/version/1.9/to/rbconfig.rb'
|
370
|
+
'rbconfig-1.8.6' => '/some/path/version/1.8/to/rbconfig.rb',
|
371
|
+
'rbconfig-1.9.1' => '/some/path/version/1.9.1/to/rbconfig.rb',
|
372
|
+
'rbconfig-3.0.0' => '/some/fake/version/3.0.0/to/rbconfig.rb'
|
350
373
|
}
|
351
374
|
end
|
375
|
+
|
376
|
+
def mock_fake_rb
|
377
|
+
mock(File, :write => 45)
|
378
|
+
end
|
352
379
|
end
|
data/tasks/bin/cross-ruby.rake
CHANGED
@@ -21,23 +21,21 @@ require 'rake'
|
|
21
21
|
require 'rake/clean'
|
22
22
|
require 'yaml'
|
23
23
|
|
24
|
+
# load compiler helpers
|
25
|
+
# add lib directory to the search path
|
26
|
+
libdir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
|
27
|
+
$LOAD_PATH.unshift(libdir) unless $LOAD_PATH.include?(libdir)
|
28
|
+
|
29
|
+
require 'rake/extensioncompiler'
|
30
|
+
|
24
31
|
USER_HOME = File.expand_path("~/.rake-compiler")
|
25
32
|
RUBY_CC_VERSION = "ruby-#{ENV['VERSION'] || '1.8.6-p287'}"
|
26
33
|
|
27
34
|
# grab the major "1.8" or "1.9" part of the version number
|
28
35
|
MAJOR = RUBY_CC_VERSION.match(/.*-(\d.\d).\d/)[1]
|
29
36
|
|
30
|
-
#
|
31
|
-
|
32
|
-
# present, I only know to search for them.
|
33
|
-
compilers = %w(i586-mingw32msvc-gcc i386-mingw32-gcc)
|
34
|
-
paths = ENV['PATH'].split(File::PATH_SEPARATOR)
|
35
|
-
compiler = compilers.find do |comp|
|
36
|
-
paths.find do |path|
|
37
|
-
File.exist? File.join(path, comp)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
MINGW_HOST = compiler[0..-5]
|
37
|
+
# Use Rake::ExtensionCompiler helpers to find the proper host
|
38
|
+
MINGW_HOST = Rake::ExtensionCompiler.mingw_host
|
41
39
|
|
42
40
|
# define a location where sources will be stored
|
43
41
|
directory "#{USER_HOME}/sources/#{RUBY_CC_VERSION}"
|
@@ -96,7 +94,7 @@ end
|
|
96
94
|
task :mingw32 do
|
97
95
|
unless MINGW_HOST then
|
98
96
|
warn "You need to install mingw32 cross compile functionality to be able to continue."
|
99
|
-
warn "Please refer to your
|
97
|
+
warn "Please refer to your distribution/package manager documentation about installation."
|
100
98
|
fail
|
101
99
|
end
|
102
100
|
end
|
@@ -113,10 +111,9 @@ end
|
|
113
111
|
file "#{USER_HOME}/builds/#{RUBY_CC_VERSION}/Makefile" => ["#{USER_HOME}/builds/#{RUBY_CC_VERSION}",
|
114
112
|
"#{USER_HOME}/sources/#{RUBY_CC_VERSION}/Makefile.in"] do |t|
|
115
113
|
|
116
|
-
# set the configure options
|
117
114
|
options = [
|
118
|
-
"--host=#{MINGW_HOST}",
|
119
115
|
'--target=i386-mingw32',
|
116
|
+
"--host=#{MINGW_HOST}",
|
120
117
|
'--build=i686-linux',
|
121
118
|
'--enable-shared',
|
122
119
|
'--disable-install-doc',
|
@@ -144,21 +141,26 @@ file "#{USER_HOME}/ruby/#{RUBY_CC_VERSION}/bin/ruby.exe" => ["#{USER_HOME}/build
|
|
144
141
|
sh "make install"
|
145
142
|
end
|
146
143
|
end
|
144
|
+
task :install => ["#{USER_HOME}/ruby/#{RUBY_CC_VERSION}/bin/ruby.exe"]
|
147
145
|
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
file :update_config => ["#{USER_HOME}/ruby/#{RUBY_CC_VERSION}/lib/ruby/#{MAJOR}/i386-mingw32/rbconfig.rb"] do |t|
|
146
|
+
desc "Update rake-compiler list of installed Ruby versions"
|
147
|
+
task 'update-config' do
|
152
148
|
config_file = "#{USER_HOME}/config.yml"
|
153
149
|
if File.exist?(config_file) then
|
154
|
-
puts "Updating #{
|
150
|
+
puts "Updating #{config_file}"
|
155
151
|
config = YAML.load_file(config_file)
|
156
152
|
else
|
157
|
-
puts "Generating #{
|
153
|
+
puts "Generating #{config_file}"
|
158
154
|
config = {}
|
159
155
|
end
|
160
156
|
|
161
|
-
|
157
|
+
files = Dir.glob("#{USER_HOME}/ruby/**/rbconfig.rb").sort
|
158
|
+
|
159
|
+
files.each do |rbconfig|
|
160
|
+
version = rbconfig.match(/.*-(\d.\d.\d)/)[1]
|
161
|
+
config["rbconfig-#{version}"] = rbconfig
|
162
|
+
puts "Found Ruby version #{version} (#{rbconfig})"
|
163
|
+
end
|
162
164
|
|
163
165
|
when_writing("Saving changes into #{config_file}") {
|
164
166
|
File.open(config_file, 'w') do |f|
|
@@ -168,7 +170,10 @@ file :update_config => ["#{USER_HOME}/ruby/#{RUBY_CC_VERSION}/lib/ruby/#{MAJOR}/
|
|
168
170
|
end
|
169
171
|
|
170
172
|
task :default do
|
173
|
+
# Force the display of the available tasks when no option is given
|
174
|
+
Rake.application.options.show_task_pattern = //
|
175
|
+
Rake.application.display_tasks_and_comments
|
171
176
|
end
|
172
177
|
|
173
178
|
desc "Build #{RUBY_CC_VERSION} suitable for cross-platform development."
|
174
|
-
task 'cross-ruby' => [:mingw32, :environment, :
|
179
|
+
task 'cross-ruby' => [:mingw32, :environment, :install, 'update-config']
|
data/tasks/cucumber.rake
CHANGED
data/tasks/gem.rake
CHANGED
data/tasks/rspec.rake
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
begin
|
2
|
-
gem 'rspec', '~> 1.1.9'
|
3
|
-
gem 'rcov', '~> 0.8.1'
|
4
2
|
require 'spec/rake/spectask'
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rcov'
|
6
|
+
rescue LoadError
|
7
|
+
warn "RCov gem is required, please install it (gem install rcov)."
|
8
|
+
end
|
9
|
+
|
10
|
+
rescue LoadError
|
11
|
+
warn "RSpec gem is required, please install it (gem install rspec)."
|
8
12
|
end
|
9
13
|
|
10
14
|
if defined?(Spec)
|
@@ -25,9 +29,6 @@ if defined?(Spec)
|
|
25
29
|
t.rcov_opts = ["--exclude", "spec/*,features/*,gems/*"]
|
26
30
|
end
|
27
31
|
end
|
28
|
-
else
|
29
|
-
warn "RCov gem is required, please install it (gem install rcov)."
|
30
32
|
end
|
31
|
-
else
|
32
|
-
warn "RSpec gem is required, please install it (gem install rspec)."
|
33
33
|
end
|
34
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-compiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Lavena
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-04 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- features/support/file_templates.rb
|
50
50
|
- features/support/generators.rb
|
51
51
|
- bin/rake-compiler
|
52
|
+
- lib/rake/extensioncompiler.rb
|
52
53
|
- lib/rake/extensiontask.rb
|
53
54
|
- spec/lib/rake/extensiontask_spec.rb
|
54
55
|
- spec/spec_helper.rb
|
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
92
|
requirements: []
|
92
93
|
|
93
94
|
rubyforge_project: rake-compiler
|
94
|
-
rubygems_version: 1.3.
|
95
|
+
rubygems_version: 1.3.1
|
95
96
|
signing_key:
|
96
97
|
specification_version: 2
|
97
98
|
summary: Rake-based Ruby C Extension task generator.
|