Skip to content
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
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
source 'https://rubygems.org'

gemspec

group :development do
gem 'rake-compiler', ">= 0.4.1"
gem 'minitest', "~> 5.0"
gem 'ruby-maven', :platforms => :jruby
end
16 changes: 1 addition & 15 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,7 @@ if RUBY_PLATFORM =~ /java/
end
else
require 'rake/extensiontask'
spec = Gem::Specification.load("psych.gemspec")
Rake::ExtensionTask.new("psych", spec) do |ext|
ext.lib_dir = File.join(*['lib', ENV['FAT_DIR']].compact)
ext.cross_compile = true
ext.cross_platform = %w[x86-mingw32 x64-mingw32]
ext.cross_compiling do |s|
s.files.concat ["lib/2.3/psych.so", "lib/2.4/psych.so", "lib/2.5/psych.so"]
end
end
end

desc "Compile binaries for mingw platform using rake-compiler-dock"
task 'build:mingw' do
require 'rake_compiler_dock'
RakeCompilerDock.sh "bundle && rake cross native gem RUBY_CC_VERSION=2.5.0:2.4.0:2.3.0"
Rake::ExtensionTask.new("psych")
end

task :default => [:compile, :test]
6 changes: 1 addition & 5 deletions lib/psych.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
end
else
begin
require "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
rescue LoadError
require 'psych.so'
end
require 'psych.so'
end
require 'psych/nodes'
require 'psych/streaming'
Expand Down
5 changes: 0 additions & 5 deletions psych.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ DESCRIPTION
s.rubygems_version = "2.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0")

s.add_development_dependency 'rake-compiler', ">= 0.4.1"
s.add_development_dependency 'minitest', "~> 5.0"

if RUBY_ENGINE == 'jruby'
s.platform = 'java'
s.files.concat [
Expand All @@ -67,9 +64,7 @@ DESCRIPTION
]
s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}"
s.add_dependency 'jar-dependencies', '>= 0.1.7'
s.add_development_dependency 'ruby-maven'
else
s.extensions = ["ext/psych/extconf.rb"]
s.add_development_dependency 'rake-compiler-dock', ">= 0.6.3"
end
end