Skip to content

Commit

Permalink
Work around rake not understanding platforms, allows Nokogiri to buil…
Browse files Browse the repository at this point in the history
…d on jruby with rubygems 1.4+
  • Loading branch information
drbrain committed Jan 31, 2011
1 parent 5fb17ce commit fe678a1
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Rakefile
Expand Up @@ -38,6 +38,8 @@ HOE = Hoe.spec 'nokogiri' do


if java if java
self.spec_extras = { :platform => 'java' } self.spec_extras = { :platform => 'java' }
self.need_tar = false # these will be built broken
self.need_zip = false
else else
self.spec_extras = { :extensions => ["ext/nokogiri/extconf.rb"] } self.spec_extras = { :extensions => ["ext/nokogiri/extconf.rb"] }
end end
Expand Down Expand Up @@ -72,9 +74,14 @@ if java
ext.lib_dir = 'lib/nokogiri' ext.lib_dir = 'lib/nokogiri'
ext.classpath = (["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar'].map { |x| File.expand_path x }).join ':' ext.classpath = (["#{jruby_home}/lib/jruby.jar"] + FileList['lib/*.jar'].map { |x| File.expand_path x }).join ':'
end end
path = "pkg/#{HOE.spec.name}-#{HOE.spec.version}"
task path => :compile do gem_build_path = File.join 'pkg', HOE.spec.full_name
cp 'lib/nokogiri/nokogiri.jar', File.join(path, 'lib') # references to tgz_build_path are to work around a rake bug
tgz_build_path = File.join 'pkg', "#{HOE.spec.name}-#{HOE.spec.version}"

task gem_build_path => [:compile, tgz_build_path] do
cp_r tgz_build_path, gem_build_path, :verbose => true
cp 'lib/nokogiri/nokogiri.jar', File.join(gem_build_path, 'lib', 'nokogiri'), :verbose => true
HOE.spec.files += ['lib/nokogiri/nokogiri.jar'] HOE.spec.files += ['lib/nokogiri/nokogiri.jar']
end end
else else
Expand Down

0 comments on commit fe678a1

Please sign in to comment.