rake-compiler 1.2.1 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 530d28062d0a6bc7601e7aec15adba736048594ad4e0026dff17594f4462a2ca
4
- data.tar.gz: 94dea28437dd1dedaef5a48f7eb13672102bc11d43a371e755d593126cac20b7
3
+ metadata.gz: 1307a1f8d635b6fa407ce62a9e301a9d2ccfb358fb77e3ed85c3d22492fd6a1e
4
+ data.tar.gz: d562c91bfee82d65d39b67b118c9b9395e33be402b2c41058d4251ae2e88a37f
5
5
  SHA512:
6
- metadata.gz: 8c4066120b1718f19299eacfee717a8efd7ca381078124e38107b372f3925791b9016aa6048bd773c6aebf6875e94937cb5eff38365e759c665102e6f55e8b1f
7
- data.tar.gz: 804376554f6efa4c5b4e62b28b2d18cbffb0273c0de6e0bbc3fb7674dc4669a1bab83e121c3dd2bb1f5c1a1cffc89b5977ca96410c7599b589affbe075c0abd9
6
+ metadata.gz: 1d1c34c803284711dff655cd8b4d7a34766d1ade90556ffeed111349777c67e143a55705bda5bce95f6629c2bc45a7e528da666f20595cb45c7e2986ee3c9269
7
+ data.tar.gz: dfabaa0805a27ee2150a406a2e7e26c6345ea279866e271c1936ab95b8090a0bb6fa0919a42509ae4d6652e8d249a694c4b70b7ace351335afb7cbace8fa7cf8
data/History.md CHANGED
@@ -1,3 +1,23 @@
1
+ ### 1.2.2 / 2023-05-25
2
+
3
+ * Enhancements:
4
+ * GH-211: Added `extra_sources` that is for dynamic sources.
5
+ [Patch by James Tucker]
6
+ * GH-213: Stopped using `--release` on Java 8.
7
+ [Patch by James Pavel Rosický]
8
+ * GH-215: Added support for extra options with space.
9
+ [Reported by Jun Aruga]
10
+
11
+ * Fixes:
12
+ * GH-211: Fixed a typo in documentation.
13
+ [Patch by Jan-Benedikt Jagusch]
14
+
15
+ * Thanks:
16
+ * James Tucker
17
+ * Jan-Benedikt Jagusch
18
+ * Pavel Rosický
19
+ * Jun Aruga
20
+
1
21
  ### 1.2.1 / 2022-12-16
2
22
 
3
23
  * Enhancements:
data/README.md CHANGED
@@ -349,7 +349,7 @@ Now, you only need specify a few additional options in your extension definition
349
349
  # platform build, with platform-specific options in a hash.
350
350
  ext.cross_config_options << '--with-common-option'
351
351
  ext.cross_config_options << {
352
- 'x86-mswin32-60 => '--with-some-option',
352
+ 'x86-mswin32-60' => '--with-some-option',
353
353
  'x64-mingw32' => '--enable-64bits',
354
354
  }
355
355
  ext.cross_config_options << '--with-final-option'
@@ -18,6 +18,7 @@ module Rake
18
18
  attr_accessor :config_options
19
19
  attr_accessor :source_pattern
20
20
  attr_accessor :extra_options
21
+ attr_accessor :extra_sources
21
22
  attr_writer :platform
22
23
 
23
24
  def platform
@@ -41,6 +42,7 @@ module Rake
41
42
  end
42
43
  @config_options = []
43
44
  @extra_options = ARGV.select { |i| i =~ /\A--?/ }
45
+ @extra_sources = FileList[]
44
46
  end
45
47
 
46
48
  def define
@@ -71,7 +73,7 @@ module Rake
71
73
  end
72
74
 
73
75
  def source_files
74
- FileList["#{@ext_dir}/#{@source_pattern}"]
76
+ FileList["#{@ext_dir}/#{@source_pattern}"] + @extra_sources
75
77
  end
76
78
 
77
79
  def warn_once(message)
@@ -199,7 +199,7 @@ Java extension should be preferred.
199
199
  abs_extconf = (Pathname.new(Dir.pwd) + extconf).realpath
200
200
 
201
201
  # now add the extconf script
202
- cmd << abs_extconf.relative_path_from(abs_tmp_path)
202
+ cmd << abs_extconf.relative_path_from(abs_tmp_path).to_s
203
203
 
204
204
  # fake.rb will be present if we are cross compiling
205
205
  if t.prerequisites.include?("#{tmp_path}/fake.rb") then
@@ -215,9 +215,7 @@ Java extension should be preferred.
215
215
  end
216
216
 
217
217
  chdir tmp_path do
218
- # FIXME: Rake is broken for multiple arguments system() calls.
219
- # Add current directory to the search path of Ruby
220
- sh cmd.join(' ')
218
+ sh *cmd
221
219
  end
222
220
  end
223
221
 
@@ -212,7 +212,7 @@ execute the Rake compilation task using the JRuby interpreter.
212
212
  end
213
213
 
214
214
  def java_target_args
215
- if @release
215
+ if @release && release_flag_supported?
216
216
  ["--release=#{@release}"]
217
217
  else
218
218
  ["-target", @target_version, "-source", @source_version]
@@ -303,5 +303,11 @@ execute the Rake compilation task using the JRuby interpreter.
303
303
 
304
304
  "-Xlint:#{@lint_option}"
305
305
  end
306
+
307
+ def release_flag_supported?
308
+ return true unless RUBY_PLATFORM =~ /java/
309
+
310
+ Gem::Version.new(Java::java.lang.System.getProperty('java.version')) >= Gem::Version.new("9")
311
+ end
306
312
  end
307
313
  end
@@ -58,6 +58,15 @@ describe Rake::ExtensionTask do
58
58
  end
59
59
  ext.platform.should == 'universal-foo-bar-10.5'
60
60
  end
61
+
62
+ it 'should allow extra sources to be added' do
63
+ ext = Rake::ExtensionTask.new('extension_one') do |ext|
64
+ ext.extra_sources << 'extra.c'
65
+ end
66
+ ext.extra_sources.should include('extra.c')
67
+ # Private API between the base task and the extension task
68
+ ext.send(:source_files).should include('extra.c')
69
+ end
61
70
  end
62
71
  end
63
72
 
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: 1.2.1
4
+ version: 1.2.2
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: 2022-12-16 00:00:00.000000000 Z
12
+ date: 2023-05-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: 1.8.23
149
149
  requirements: []
150
- rubygems_version: 3.4.0.dev
150
+ rubygems_version: 3.5.0.dev
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Rake-based Ruby Extension (C, Java) task generator.