rake-compiler 1.1.8 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56dcf0e1f328862dc1b7b48d04288ee04cc36faab9d1a598b1bafa242673314c
4
- data.tar.gz: 8283eec481c7d7adb3589de86a205c9747f4a428e3a2a8d9485c930f1ac58d17
3
+ metadata.gz: 3dac2b65206bc383a7e2f5bca57d0ef5f6b2e0a79d94af9cfefac60f9b91577a
4
+ data.tar.gz: 4e7592c9bd0bfa0a2bdcdb8bfe0a67ccff6d0ce47d4d51b68b3c17156083c9dd
5
5
  SHA512:
6
- metadata.gz: '08f90e5666ece41d70892f20cbc06ff42d8d2ef3f46ad1669ed1e75d3b6e96f2867c4072481a20656b8aaa90208df2a34cfc14e16a9510bba320829aa683b2c3'
7
- data.tar.gz: 69426e3024fcb826bed92b86a9a63ad4b6b1203dd202758decb2e93a73f76cb7d7724492f56be61bb33dfb18b11cdbae796da87e1b02557c9bc32b59412a70f1
6
+ metadata.gz: dc0df40a879127c77bc137af890bd8880395963ce6b133e4ac4c3b2ec207d42503dc67a04856f0d07410161ebd5bd4401dad049afdf2ce9fa8abcaeee9a61df8
7
+ data.tar.gz: bd91ba1ed6881011a69870933873cd5112a5c6af3ee4fc2977992201e403deb2ffdc31eea874f1b7f32bd3b515b06b7e474fc5bb943f1e381c99d25dfd216205
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 1.1.9 / 2022-01-22
2
+
3
+ * Enhancements:
4
+ * Add support for `--release` option to build JRuby extension.
5
+ [#200](https://github.com/rake-compiler/rake-compiler/issues/200) [Reported by Pavel Rosický]
6
+ [#201](https://github.com/rake-compiler/rake-compiler/issues/201) [Patch by Satoshi Tagomori]
7
+
1
8
  ### 1.1.8 / 2022-01-18
2
9
 
3
10
  * Fixes:
@@ -17,6 +17,9 @@ module Rake
17
17
  # Generate class files for specific VM version
18
18
  attr_accessor :target_version
19
19
 
20
+ # Compile for oldeer platform version
21
+ attr_accessor :release
22
+
20
23
  attr_accessor :encoding
21
24
 
22
25
  # Specify lint option
@@ -37,6 +40,7 @@ module Rake
37
40
  @debug = false
38
41
  @source_version = '1.7'
39
42
  @target_version = '1.7'
43
+ @release = nil
40
44
  @encoding = nil
41
45
  @java_compiling = nil
42
46
  @lint_option = nil
@@ -106,8 +110,7 @@ execute the Rake compilation task using the JRuby interpreter.
106
110
 
107
111
  javac_command_line = [
108
112
  "javac",
109
- "-target", @target_version,
110
- "-source", @source_version,
113
+ *java_target_args,
111
114
  java_lint_arg,
112
115
  "-d", tmp_path,
113
116
  ]
@@ -208,6 +211,14 @@ execute the Rake compilation task using the JRuby interpreter.
208
211
  end
209
212
  end
210
213
 
214
+ def java_target_args
215
+ if @release
216
+ ["--release=#{@release}"]
217
+ else
218
+ ["-target", @target_version, "-source", @source_version]
219
+ end
220
+ end
221
+
211
222
  #
212
223
  # Discover Java Extension Directories and build an extdirs arguments
213
224
  #
@@ -175,11 +175,13 @@ describe Rake::JavaExtensionTask do
175
175
  let(:extension) do
176
176
  Rake::JavaExtensionTask.new('extension_two') do |ext|
177
177
  ext.lint_option = lint_option if lint_option
178
+ ext.release = release if release
178
179
  end
179
180
  end
180
181
 
181
182
  context 'without a specified lint option' do
182
183
  let(:lint_option) { nil }
184
+ let(:release) { nil }
183
185
 
184
186
  it 'should honor the lint option' do
185
187
  (extension.lint_option).should be_falsey
@@ -189,12 +191,35 @@ describe Rake::JavaExtensionTask do
189
191
 
190
192
  context "with a specified lint option of 'deprecated'" do
191
193
  let(:lint_option) { 'deprecated'.freeze }
194
+ let(:release) { nil }
192
195
 
193
196
  it 'should honor the lint option' do
194
197
  (extension.lint_option).should eq lint_option
195
198
  (extension.send :java_lint_arg).should eq '-Xlint:deprecated'
196
199
  end
197
200
  end
201
+
202
+ context "without release option" do
203
+ let(:lint_option) { nil }
204
+ let(:release) { nil }
205
+
206
+ it 'should generate -target and -source build options' do
207
+ extension.target_version = "1.8"
208
+ extension.source_version = "1.8"
209
+ (extension.send :java_target_args).should eq ["-target", "1.8", "-source", "1.8"]
210
+ end
211
+ end
212
+
213
+ context "with release option" do
214
+ let(:lint_option) { nil }
215
+ let(:release) { '8' }
216
+
217
+ it 'should generate --release option even with target_version/source_version' do
218
+ extension.target_version = "1.8"
219
+ extension.source_version = "1.8"
220
+ (extension.send :java_target_args).should eq ["--release=8"]
221
+ end
222
+ end
198
223
  end
199
224
  end
200
225
  private
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.1.8
4
+ version: 1.1.9
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-01-17 00:00:00.000000000 Z
12
+ date: 2022-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake