Skip to content

Commit

Permalink
Import JRuby's stringio impl (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
headius authored Apr 15, 2022
1 parent 4bf7951 commit cbbad15
Show file tree
Hide file tree
Showing 8 changed files with 1,586 additions and 9 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os:
- ubuntu-20.04
- ubuntu-18.04
ruby: [ '3.0', '2.7', '2.6', 'debug', 'head' ]
ruby: [ '3.0', '2.7', '2.6', 'debug', 'head', 'jruby-head' ]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand All @@ -22,3 +22,5 @@ jobs:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run test
run: bundle exec rake
- name: Build gem
run: gem install rake-compiler && rake build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
*.bundle
*.dll
*.so
*.jar
Makefile
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ source "https://rubygems.org"
gemspec

gem 'rake-compiler'
gem 'test-unit'

group :development do
gem 'test-unit'
gem 'ruby-maven', :platforms => :jruby
end
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@ require "rake/testtask"

name = "stringio"

require 'rake/extensiontask'
extask = Rake::ExtensionTask.new(name) do |x|
x.lib_dir << "/#{RUBY_VERSION}/#{x.platform}"
if RUBY_PLATFORM =~ /java/
require 'rake/javaextensiontask'
extask = Rake::JavaExtensionTask.new("stringio") do |ext|
require 'maven/ruby/maven'
ext.source_version = '1.8'
ext.target_version = '1.8'
ext.ext_dir = 'ext/java'
end
else
require 'rake/extensiontask'
extask = Rake::ExtensionTask.new(name) do |x|
x.lib_dir << "/#{RUBY_VERSION}/#{x.platform}"
end
end
Rake::TestTask.new(:test) do |t|
ENV["RUBYOPT"] = "-I" + [extask.lib_dir, "test/lib"].join(File::PATH_SEPARATOR)
Expand Down
Loading

0 comments on commit cbbad15

Please sign in to comment.