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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- #592: chore: relax rubyzip requirement to allow rubyzip 2.x
- #593: chore: relax jruby-rack requirement to allow compatibility with upcoming 1.3.x
- #624: chore: remove use of deprecated JRuby methods removed in JRuby 10.1
- #634: chore: deprecate JBundler trait for removal

## 2.1.0

Expand Down
10 changes: 7 additions & 3 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,14 @@ Warbler supports Bundler for gems and git repositories, but not for plain path
components. Warbler will warn when a +:path+ component is found in the +Gemfile+
and will refuse to include it in the archive.

=== JBundler (experimental)
=== JBundler (deprecated, experimental)

Applications that use JBundler[http://github.com/mkristian/jbundler], detected
via presence of a +Jarfile+, will have the jars packaged up into the archive. the JBundler gem is **not** needed for runtime since all jars are already part of the classloader.
Applications that use JBundler[http://github.com/jruby/jbundler], detected via presence of a +Jarfile+, will have
the jars packaged up into the archive. The JBundler gem is **not** needed for runtime since all jars are already part of the classloader.

JBundler is EOL; and this capability is thus deprecated for removal in a future release, and is not recommended for use.
The recommended replacement is bundler with +jar-dependencies+ (bundled with modern JRuby); but requires some work for
compatibility. See https://github.com/jruby/warbler/issues/481 for more details and contribute if you'd like this feature to be retained and supported.

== War Files

Expand Down
2 changes: 1 addition & 1 deletion lib/warbler/jar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,6 @@ def entry_in_jar(jar, entry)

# Java-boosted jar creation for JRuby; replaces #create_jar and
# #entry_in_jar with Java version
require 'warbler_jar' if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.5"
require 'warbler_jar' if defined?(JRUBY_VERSION)
end
end
3 changes: 2 additions & 1 deletion lib/warbler/traits/jbundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def self.requirements

def before_configure
config.jbundler = true
warn "JBundler support is deprecated due to the EOL of JBundler. See https://github.com/jruby/warbler/issues/481 for discussion on replacement with jar-dependencies."
end

def after_configure
Expand All @@ -35,7 +36,7 @@ def add_jbundler_jars
if File.exist?( classpath )
require File.expand_path( classpath )
else
raise 'jbundler support needs jruby to create a local config: jruby -S jbundle install'
raise 'JBundler support needs JRuby to create a local config: jruby -S jbundle install'
end
# use only the jars from jbundler and jruby
config.java_libs += jruby_jars
Expand Down
32 changes: 11 additions & 21 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,17 @@ def run_out_of_process_with_drb
end
end

if defined?(JRUBY_VERSION)
require 'jruby'
let(:drb) do
drb_thread = Thread.new do
ruby '--dev', "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
end
drb_thread.run
drb_thread
end
after :each do
drbclient.stop
drb.join
end
else
require 'childprocess'
let(:drb) do
ChildProcess.build(FileUtils::RUBY, "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')).tap {|d| d.start }
end
after :each do
drb.stop
let(:drb) do
drb_thread = Thread.new do
ruby '--dev', "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
end
drb_thread.run
drb_thread
end

after :each do
drbclient.stop
drb.join
end

after :all do
Expand Down Expand Up @@ -223,6 +213,6 @@ class << ::Object

config.after :each do
Object.remove_const("Rails") if defined?(Rails)
rm_rf "vendor"
silence { rm_rf "vendor" }
end
end
6 changes: 4 additions & 2 deletions spec/warbler/jbundler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def apply_silently
expect(config.traits).to include(Warbler::Traits::JBundler)
end

it "logs deprecation" do
expect(capture { Warbler::Traits::JBundler.new(config).before_configure }).to match /JBundler support is deprecated/
end

it "detects a Jarfile and process only its jars" do
use_config do |config|
config.java_libs << "local.jar"
Expand Down Expand Up @@ -72,14 +76,12 @@ def apply_silently
run_in_directory "spec/sample_jbundler"

it "does not include the jbundler gem (as it is in the development group)" do
pending( "needs JRuby to work" ) unless defined? JRUBY_VERSION
apply_silently
expect(config.gems.detect{|k,v| k.name == 'jbundler'}).to be nil
expect(file_list(/jbundler-/)).to be_empty
end

it "does not include the jbundler runtime config" do
pending( "needs JRuby to work" ) unless defined? JRUBY_VERSION
apply_silently
expect(file_list(%r{WEB-INF/.jbundler})).to be_empty
end
Expand Down
2 changes: 1 addition & 1 deletion spec/warbler/task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def run_task(t)
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
expect(zf.find_entry("WEB-INF/lib/tasks/utils.rake")).to_not be nil
expect(zf.find_entry("WEB-INF/lib/rakelib/")).to_not be nil
expect(zf.find_entry("WEB-INF/lib/rakelib/utils.rake")).to_not be nil if defined?(JRUBY_VERSION)
expect(zf.find_entry("WEB-INF/lib/rakelib/utils.rake")).to_not be nil
end
end

Expand Down
2 changes: 1 addition & 1 deletion warble.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# - `Warbler::Traits::Bundler` - package with the gems implied by a bundle Gemfile/Gemfile.lock
# - `Warbler::Traits::Gemspec` - package with the gems implied by a gemspec
# - `Warbler::Traits::NoGemspec` - package only with the gems implied by that in a local `lib` folder
# - `Warbler::Traits::JBundler` - (experimental) package with the jars implied by a `Jarfile`
# - `Warbler::Traits::JBundler` - (deprecated, experimental) package with the jars implied by a `Jarfile`
# - `Warbler::Traits::Rails` - package with the necessary startup logic to boot a Rails application
# - `Warbler::Traits::Rack` - package with the necessary startup logic to boot a standalone Rack (non-Rails) application
# forced_traits = [Warbler::Traits::Jar]
Expand Down