rake-compiler 0.9.4 → 0.9.5
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.
- checksums.yaml +4 -4
- data/History.txt +6 -0
- data/README.rdoc +4 -5
- data/lib/rake/extensiontask.rb +25 -21
- data/spec/lib/rake/extensiontask_spec.rb +30 -0
- data/tasks/gem.rake +1 -1
- data/tasks/rspec.rake +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27afa23965c11369d4a99dfb0bff5050e481a184
|
4
|
+
data.tar.gz: 2a7b657c3e7d72e18521f1104a2bf13eca469062
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63d63315f3b86beca6b95293f84aaab057d4bb35658e0b62db7269eeb46fffdfc1d999003a3346f9ff495fc28abd91cd465adc573fcbb0b807c5ba7478ce519d
|
7
|
+
data.tar.gz: b19295ad94ad980d2b2046558c376657e4b5f7bdeb811c0eb5638aba76148519d3aa5decf80394e64076edfa3ae93f00c20052e000f8008f8629aaaf4ced3a0f
|
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -390,7 +390,7 @@ So, what if I show you some examples?
|
|
390
390
|
Check our wiki with links to the proper rake files used by many developers and
|
391
391
|
projects and how they use rake-compiler.
|
392
392
|
|
393
|
-
http://github.com/
|
393
|
+
http://github.com/rake-compiler/rake-compiler/wiki/projects-using-rake-compiler
|
394
394
|
|
395
395
|
== Future
|
396
396
|
|
@@ -399,11 +399,10 @@ during the development of it! (and contributions too!)
|
|
399
399
|
|
400
400
|
You can find more information about rake-compiler:
|
401
401
|
|
402
|
-
* GitHub: https://github.com/
|
403
|
-
* Issues: https://github.com/
|
404
|
-
* Blog: http://blog.mmediasys.com
|
402
|
+
* GitHub: https://github.com/rake-compiler/rake-compiler
|
403
|
+
* Issues: https://github.com/rake-compiler/rake-compiler/issues
|
405
404
|
* Docs: http://rubydoc.info/gems/rake-compiler
|
406
|
-
* Wiki: https://github.com/
|
405
|
+
* Wiki: https://github.com/rake-compiler/rake-compiler/wiki
|
407
406
|
|
408
407
|
== Disclaimer
|
409
408
|
|
data/lib/rake/extensiontask.rb
CHANGED
@@ -87,6 +87,26 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
|
|
87
87
|
end
|
88
88
|
|
89
89
|
private
|
90
|
+
# copy other gem files to staging directory
|
91
|
+
def define_staging_file_tasks(files, lib_path, stage_path, platf, ruby_ver)
|
92
|
+
files.each do |gem_file|
|
93
|
+
# ignore directories and the binary extension
|
94
|
+
next if File.directory?(gem_file) || gem_file == "#{lib_path}/#{binary(platf)}"
|
95
|
+
stage_file = "#{stage_path}/#{gem_file}"
|
96
|
+
|
97
|
+
# copy each file from base to stage directory
|
98
|
+
unless Rake::Task.task_defined?(stage_file) then
|
99
|
+
directory File.dirname(stage_file)
|
100
|
+
file stage_file => [File.dirname(stage_file), gem_file] do
|
101
|
+
cp gem_file, stage_file
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# append each file to the copy task
|
106
|
+
task "copy:#{@name}:#{platf}:#{ruby_ver}" => [stage_file]
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
90
110
|
def define_compile_tasks(for_platform = nil, ruby_ver = RUBY_VERSION)
|
91
111
|
# platform usage
|
92
112
|
platf = for_platform || platform
|
@@ -120,24 +140,7 @@ Rerun `rake` under MRI Ruby 1.8.x/1.9.x to cross/native compile.
|
|
120
140
|
end
|
121
141
|
|
122
142
|
# copy other gem files to staging directory
|
123
|
-
if @gem_spec
|
124
|
-
@gem_spec.files.each do |gem_file|
|
125
|
-
# ignore directories and the binary extension
|
126
|
-
next if File.directory?(gem_file) || gem_file == "#{lib_path}/#{binary(platf)}"
|
127
|
-
stage_file = "#{stage_path}/#{gem_file}"
|
128
|
-
|
129
|
-
# copy each file from base to stage directory
|
130
|
-
unless Rake::Task.task_defined?(stage_file) then
|
131
|
-
directory File.dirname(stage_file)
|
132
|
-
file stage_file => [File.dirname(stage_file), gem_file] do
|
133
|
-
cp gem_file, stage_file
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
|
-
# append each file to the copy task
|
138
|
-
task "copy:#{@name}:#{platf}:#{ruby_ver}" => [stage_file]
|
139
|
-
end
|
140
|
-
end
|
143
|
+
define_staging_file_tasks(@gem_spec.files, lib_path, stage_path, platf, ruby_ver) if @gem_spec
|
141
144
|
|
142
145
|
# binary in temporary folder depends on makefile and source files
|
143
146
|
# tmp/extension_name/extension_name.{so,bundle}
|
@@ -253,9 +256,7 @@ Java extension should be preferred.
|
|
253
256
|
spec.files += ext_files
|
254
257
|
|
255
258
|
# expose gem specification for customization
|
256
|
-
if callback
|
257
|
-
callback.call(spec)
|
258
|
-
end
|
259
|
+
callback.call(spec) if callback
|
259
260
|
|
260
261
|
# Generate a package for this gem
|
261
262
|
pkg = Gem::PackageTask.new(spec) do |pkg|
|
@@ -266,6 +267,9 @@ Java extension should be preferred.
|
|
266
267
|
pkg.package_files.clear
|
267
268
|
end
|
268
269
|
|
270
|
+
# copy other gem files to staging directory if added by the callback
|
271
|
+
define_staging_file_tasks(spec.files, lib_path, stage_path, platf, ruby_ver)
|
272
|
+
|
269
273
|
# Copy from staging directory to gem package directory.
|
270
274
|
# This is derived from the code of Gem::PackageTask
|
271
275
|
# but uses stage_path as source directory.
|
@@ -338,6 +338,36 @@ describe Rake::ExtensionTask do
|
|
338
338
|
}.should_not raise_error
|
339
339
|
end
|
340
340
|
|
341
|
+
it 'should generate additional rake tasks if files are added when cross compiling' do
|
342
|
+
config = mock(Hash)
|
343
|
+
config.stub!(:[]).and_return('/rubies/1.9.1/rbconfig.rb')
|
344
|
+
YAML.stub!(:load_file).and_return(config)
|
345
|
+
|
346
|
+
# Use a real spec instead of a mock because define_native_tasks dups and
|
347
|
+
# calls methods on Gem::Specification, which is more than mock can do.
|
348
|
+
spec = Gem::Specification.new do |s|
|
349
|
+
s.name = 'my_gem'
|
350
|
+
s.platform = Gem::Platform::RUBY
|
351
|
+
end
|
352
|
+
|
353
|
+
# Gem::PackageTask calls Rake::PackageTask which sets Gem.configuration.verbose,
|
354
|
+
# which initializes Gem::ConfigFile,
|
355
|
+
# which gets mad if it cannot find `sysconfdir`/gemrc
|
356
|
+
Gem.stub_chain(:configuration, :verbose=).and_return(true)
|
357
|
+
|
358
|
+
ENV['RUBY_CC_VERSION'] = '1.9.1'
|
359
|
+
Rake::ExtensionTask.new('extension_one', spec) do |ext|
|
360
|
+
ext.cross_compile = true
|
361
|
+
ext.cross_platform = 'universal-unknown'
|
362
|
+
ext.cross_compiling do |gem_spec|
|
363
|
+
gem_spec.files << 'somedir/somefile'
|
364
|
+
end
|
365
|
+
end
|
366
|
+
Rake::Task['native:my_gem:universal-unknown'].execute
|
367
|
+
Rake::Task.should have_defined("tmp/universal-unknown/stage/somedir")
|
368
|
+
Rake::Task.should have_defined("tmp/universal-unknown/stage/somedir/somefile")
|
369
|
+
end
|
370
|
+
|
341
371
|
it 'should allow usage of RUBY_CC_VERSION to indicate a different version of ruby' do
|
342
372
|
config = mock(Hash)
|
343
373
|
config.should_receive(:[]).with("rbconfig-i386-mingw32-1.9.1").and_return('/rubies/1.9.1/rbconfig.rb')
|
data/tasks/gem.rake
CHANGED
data/tasks/rspec.rake
CHANGED
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.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|