Skip to content

Commit ee6d082

Browse files
authored
Merge pull request #634 from chadlwilson/deprecate-jbundler
chore: deprecate JBundler support for eventual removal
2 parents d1fe199 + 975da6d commit ee6d082

8 files changed

Lines changed: 28 additions & 30 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
- #592: chore: relax rubyzip requirement to allow rubyzip 2.x
99
- #593: chore: relax jruby-rack requirement to allow compatibility with upcoming 1.3.x
1010
- #624: chore: remove use of deprecated JRuby methods removed in JRuby 10.1
11+
- #634: chore: deprecate JBundler trait for removal
1112

1213
## 2.1.0
1314

README.rdoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ Warbler supports Bundler for gems and git repositories, but not for plain path
139139
components. Warbler will warn when a +:path+ component is found in the +Gemfile+
140140
and will refuse to include it in the archive.
141141

142-
=== JBundler (experimental)
142+
=== JBundler (deprecated, experimental)
143143

144-
Applications that use JBundler[http://github.com/mkristian/jbundler], detected
145-
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.
144+
Applications that use JBundler[http://github.com/jruby/jbundler], detected via presence of a +Jarfile+, will have
145+
the jars packaged up into the archive. The JBundler gem is **not** needed for runtime since all jars are already part of the classloader.
146+
147+
JBundler is EOL; and this capability is thus deprecated for removal in a future release, and is not recommended for use.
148+
The recommended replacement is bundler with +jar-dependencies+ (bundled with modern JRuby); but requires some work for
149+
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.
146150

147151
== War Files
148152

lib/warbler/jar.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,6 @@ def entry_in_jar(jar, entry)
334334

335335
# Java-boosted jar creation for JRuby; replaces #create_jar and
336336
# #entry_in_jar with Java version
337-
require 'warbler_jar' if defined?(JRUBY_VERSION) && JRUBY_VERSION >= "1.5"
337+
require 'warbler_jar' if defined?(JRUBY_VERSION)
338338
end
339339
end

lib/warbler/traits/jbundler.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def self.requirements
2323

2424
def before_configure
2525
config.jbundler = true
26+
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."
2627
end
2728

2829
def after_configure
@@ -35,7 +36,7 @@ def add_jbundler_jars
3536
if File.exist?( classpath )
3637
require File.expand_path( classpath )
3738
else
38-
raise 'jbundler support needs jruby to create a local config: jruby -S jbundle install'
39+
raise 'JBundler support needs JRuby to create a local config: jruby -S jbundle install'
3940
end
4041
# use only the jars from jbundler and jruby
4142
config.java_libs += jruby_jars

spec/spec_helper.rb

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -123,27 +123,17 @@ def run_out_of_process_with_drb
123123
end
124124
end
125125

126-
if defined?(JRUBY_VERSION)
127-
require 'jruby'
128-
let(:drb) do
129-
drb_thread = Thread.new do
130-
ruby '--dev', "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
131-
end
132-
drb_thread.run
133-
drb_thread
134-
end
135-
after :each do
136-
drbclient.stop
137-
drb.join
138-
end
139-
else
140-
require 'childprocess'
141-
let(:drb) do
142-
ChildProcess.build(FileUtils::RUBY, "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')).tap {|d| d.start }
143-
end
144-
after :each do
145-
drb.stop
126+
let(:drb) do
127+
drb_thread = Thread.new do
128+
ruby '--dev', "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
146129
end
130+
drb_thread.run
131+
drb_thread
132+
end
133+
134+
after :each do
135+
drbclient.stop
136+
drb.join
147137
end
148138

149139
after :all do
@@ -223,6 +213,6 @@ class << ::Object
223213

224214
config.after :each do
225215
Object.remove_const("Rails") if defined?(Rails)
226-
rm_rf "vendor"
216+
silence { rm_rf "vendor" }
227217
end
228218
end

spec/warbler/jbundler_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ def apply_silently
4040
expect(config.traits).to include(Warbler::Traits::JBundler)
4141
end
4242

43+
it "logs deprecation" do
44+
expect(capture { Warbler::Traits::JBundler.new(config).before_configure }).to match /JBundler support is deprecated/
45+
end
46+
4347
it "detects a Jarfile and process only its jars" do
4448
use_config do |config|
4549
config.java_libs << "local.jar"
@@ -72,14 +76,12 @@ def apply_silently
7276
run_in_directory "spec/sample_jbundler"
7377

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

8184
it "does not include the jbundler runtime config" do
82-
pending( "needs JRuby to work" ) unless defined? JRUBY_VERSION
8385
apply_silently
8486
expect(file_list(%r{WEB-INF/.jbundler})).to be_empty
8587
end

spec/warbler/task_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def run_task(t)
166166
Warbler::ZipSupport.open("#{config.jar_name}.war") do |zf|
167167
expect(zf.find_entry("WEB-INF/lib/tasks/utils.rake")).to_not be nil
168168
expect(zf.find_entry("WEB-INF/lib/rakelib/")).to_not be nil
169-
expect(zf.find_entry("WEB-INF/lib/rakelib/utils.rake")).to_not be nil if defined?(JRUBY_VERSION)
169+
expect(zf.find_entry("WEB-INF/lib/rakelib/utils.rake")).to_not be nil
170170
end
171171
end
172172

warble.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# - `Warbler::Traits::Bundler` - package with the gems implied by a bundle Gemfile/Gemfile.lock
1111
# - `Warbler::Traits::Gemspec` - package with the gems implied by a gemspec
1212
# - `Warbler::Traits::NoGemspec` - package only with the gems implied by that in a local `lib` folder
13-
# - `Warbler::Traits::JBundler` - (experimental) package with the jars implied by a `Jarfile`
13+
# - `Warbler::Traits::JBundler` - (deprecated, experimental) package with the jars implied by a `Jarfile`
1414
# - `Warbler::Traits::Rails` - package with the necessary startup logic to boot a Rails application
1515
# - `Warbler::Traits::Rack` - package with the necessary startup logic to boot a standalone Rack (non-Rails) application
1616
# forced_traits = [Warbler::Traits::Jar]

0 commit comments

Comments
 (0)