Skip to content

Commit

Permalink
Add ruby source files to the java gem
Browse files Browse the repository at this point in the history
Related to ffi#747 .
JRuby-9.3 is expected to be fully compatible to this gem's Ruby code.
This allows to ship the Ruby library code per platform java gem and add it as a default gem to JRuby.
  • Loading branch information
larskanis committed Mar 30, 2020
1 parent 3790ea6 commit 9b269a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
13 changes: 3 additions & 10 deletions Rakefile
Expand Up @@ -65,16 +65,9 @@ task :default => :spec

namespace 'java' do

java_gem_spec = Gem::Specification.new do |s|
s.name = gem_spec.name
s.version = gem_spec.version
s.author = gem_spec.author
s.email = gem_spec.email
s.homepage = gem_spec.homepage
s.summary = gem_spec.summary
s.description = gem_spec.description
s.files = %w(LICENSE COPYING README.md CHANGELOG.md Rakefile)
s.license = gem_spec.license
java_gem_spec = gem_spec.dup.tap do |s|
s.files.reject! { |f| File.fnmatch?("ext/*", f) }
s.extensions = []
s.platform = 'java'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ffi.rb
Expand Up @@ -8,7 +8,7 @@

require 'ffi/ffi'

elsif RUBY_ENGINE == 'jruby'
elsif RUBY_ENGINE == 'jruby' && Gem::Version.new(JRUBY_VERSION) >= Gem::Version.new("9.3.pre")
JRuby::Util.load_ext("org.jruby.ext.ffi.FFIService")
require 'ffi/ffi'

Expand Down

0 comments on commit 9b269a6

Please sign in to comment.