Skip to content

Commit

Permalink
pack bundled gems into jruby-stdlib=jar
Browse files Browse the repository at this point in the history
fixes #5196
  • Loading branch information
mkristian committed Jun 2, 2018
1 parent bbed5b2 commit d9f1ecb
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/pom.rb
Expand Up @@ -298,8 +298,23 @@ def installer.ensure_required_ruby_version_met; end
plugin( 'org.codehaus.mojo:build-helper-maven-plugin' )

build do

# both resources are includes for the $jruby_home/lib directory
resource do
directory '${gem.home}'
# assume all dependencies are met with this gems + the default gems
incl = bundled_gems.collect do |bgem|
[
"cache/#{bgem[0]}*#{bgem[1]}.gem",
"gems/#{bgem[0]}*#{bgem[1]}/*",
"specifications/#{bgem[0]}*#{bgem[1]}.gemspec"
]
end.flatten
excl = default_gems.collect do |bgem|
"gems/#{bgem.name}*#{bgem.version}/*"
end
includes incl
excludes excl
target_path '${jruby.complete.gems}'
end

resource do
directory '${gem.home}'
Expand Down
42 changes: 42 additions & 0 deletions lib/pom.xml
Expand Up @@ -307,6 +307,48 @@ DO NOT MODIFIY - GENERATED CODE
</extension>
</extensions>
<resources>
<resource>
<targetPath>${jruby.complete.gems}</targetPath>
<directory>${gem.home}</directory>
<includes>
<include>cache/did_you_mean*1.2.0.gem</include>
<include>gems/did_you_mean*1.2.0/*</include>
<include>specifications/did_you_mean*1.2.0.gemspec</include>
<include>cache/minitest*${minitest.version}.gem</include>
<include>gems/minitest*${minitest.version}/*</include>
<include>specifications/minitest*${minitest.version}.gemspec</include>
<include>cache/net-telnet*0.1.1.gem</include>
<include>gems/net-telnet*0.1.1/*</include>
<include>specifications/net-telnet*0.1.1.gemspec</include>
<include>cache/power_assert*${power_assert.version}.gem</include>
<include>gems/power_assert*${power_assert.version}/*</include>
<include>specifications/power_assert*${power_assert.version}.gemspec</include>
<include>cache/rake*${rake.version}.gem</include>
<include>gems/rake*${rake.version}/*</include>
<include>specifications/rake*${rake.version}.gemspec</include>
<include>cache/test-unit*${test-unit.version}.gem</include>
<include>gems/test-unit*${test-unit.version}/*</include>
<include>specifications/test-unit*${test-unit.version}.gemspec</include>
<include>cache/xmlrpc*0.3.0.gem</include>
<include>gems/xmlrpc*0.3.0/*</include>
<include>specifications/xmlrpc*0.3.0.gemspec</include>
</includes>
<excludes>
<exclude>gems/cmath*1.0.0/*</exclude>
<exclude>gems/csv*1.0.0/*</exclude>
<exclude>gems/fileutils*1.1.0/*</exclude>
<exclude>gems/ipaddr*1.2.0/*</exclude>
<exclude>gems/jar-dependencies*${jar-dependencies.version}/*</exclude>
<exclude>gems/jruby-readline*1.2.2/*</exclude>
<exclude>gems/jruby-openssl*0.10.0/*</exclude>
<exclude>gems/json*${json.version}/*</exclude>
<exclude>gems/psych*3.0.2/*</exclude>
<exclude>gems/rake-ant*1.0.4/*</exclude>
<exclude>gems/rdoc*${rdoc.version}/*</exclude>
<exclude>gems/scanf*1.0.0/*</exclude>
<exclude>gems/webrick*1.4.2/*</exclude>
</excludes>
</resource>
<resource>
<targetPath>${jruby.complete.gems}</targetPath>
<directory>${gem.home}</directory>
Expand Down

1 comment on commit d9f1ecb

@headius
Copy link
Member

@headius headius commented on d9f1ecb Jun 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, makes sense.

Please sign in to comment.