Skip to content

Use ruby-core-tasks #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ group :development do
gem 'ruby-maven', :platforms => :jruby
gem 'test-unit'
gem 'test-unit-ruby-core'
gem 'ruby-core-tasks', github: 'ruby/ruby-core-tasks'
end
20 changes: 8 additions & 12 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ require "rdoc/task"

name = "stringio"

helper = Bundler::GemHelper.instance

case RUBY_ENGINE
when "jruby"
require 'rake/javaextensiontask'
Expand All @@ -13,30 +15,24 @@ when "jruby"
ext.target_version = '1.8'
ext.ext_dir = 'ext/java'
end
libs = [extask.lib_dir]

task :build => "#{extask.lib_dir}/#{extask.name}.jar"
when "ruby"
require 'rake/extensiontask'
extask = Rake::ExtensionTask.new(name) do |x|
x.lib_dir << "/#{RUBY_VERSION}/#{x.platform}"
end
require "ruby-core/extensiontask"
libs = RubyCore::ExtensionTask.new(helper.gemspec).libs
task :test => :compile
else
task :compile
end

Rake::TestTask.new(:test) do |t|
if extask
ENV["RUBYOPT"] = "-I" + [extask.lib_dir, "test/lib"].join(File::PATH_SEPARATOR)
t.libs << extask.lib_dir
else
ENV["RUBYOPT"] = "-Itest/lib"
end
t.libs << "test/lib"
t.libs.push(*libs, "test/lib")
ENV["RUBYOPT"] = "-I" + t.libs.join(File::PATH_SEPARATOR)
t.ruby_opts << "-rhelper"
t.test_files = FileList["test/**/test_*.rb"]
end

helper = Bundler::GemHelper.instance
RDoc::Task.new do |rdoc|
rdoc.rdoc_files.push("COPYING", "LICENSE.txt",
"NEWS.md", "README.md",
Expand Down
Loading