Skip to content

Commit b47f903

Browse files
authored
Merge pull request #559 from headius/renaissance
Fixes to update Warbler to modern libs and JRuby
2 parents 68d1ce3 + b36be51 commit b47f903

File tree

21 files changed

+275
-195
lines changed

21 files changed

+275
-195
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
java-version: [8, 11, 15]
21-
ruby-version: [jruby-9.2.21.0, jruby-9.3.15.0, jruby-9.4.12.0, jruby-head]
22-
bundler-version: [1.17.3, 2.3.26, 2.4.21]
20+
java-version: [8, 21]
21+
ruby-version: [jruby-9.4, jruby-10]
2322
task: ['', integration]
2423
exclude:
25-
- ruby-version: jruby-9.2.21.0
26-
bundler-version: 2.4.21
24+
# JRuby 10 requires Java 21 minimum
25+
- ruby-version: jruby-10
26+
java-version: 8
2727

2828
fail-fast: false
2929

30+
env:
31+
# speed up all those subprocesses
32+
JRUBY_OPTS: --dev
33+
3034
steps:
3135
- name: checkout
3236
uses: actions/checkout@v3
@@ -42,21 +46,11 @@ jobs:
4246
with:
4347
ruby-version: ${{ matrix.ruby-version }}
4448

45-
- name: Install bundler ${{ matrix.bundler-version }}
46-
run: gem install bundler:${{ matrix.bundler-version }}
47-
if: ${{ matrix.ruby-version == 'jruby-9.2.21.0' }}
48-
49-
- name: Install latest rubygems version with bundler ${{ matrix.bundler-version }}
50-
run: gem update --system && gem install bundler:${{ matrix.bundler-version }}
51-
if: ${{ matrix.ruby-version != 'jruby-9.2.21.0' }}
49+
- name: Remove jruby-launcher # not sure where this is coming from but causes some specs to fail
50+
run: gem uninstall -a jruby-launcher
5251

5352
- name: Install dependencies
54-
run: bundle _${{ matrix.bundler-version }}_ install --jobs=3 --retry=3
53+
run: bundle install --jobs=3 --retry=3
5554

5655
- name: Run tests
5756
run: bundle exec rake ${{ matrix.TASK }}
58-
if: ${{ matrix.ruby-version != 'jruby-head' }}
59-
60-
- name: Run tests
61-
run: bundle exec rake ${{ matrix.TASK }} || exit 0
62-
if: ${{ matrix.ruby-version == 'jruby-head' }}

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ gemspec
55
rubyzip_version = ENV['RUBYZIP_VERSION']
66
gem 'rubyzip', rubyzip_version if rubyzip_version && !rubyzip_version.empty?
77

8+
# override default maven-tools used by bundler
9+
gem 'maven-tools', '1.2.3'
10+
11+
812
group :development, :test do
913
gem 'rdoc', ['>= 3.10', '< 4.3'], :require => nil
14+
15+
# force jruby-jars to use current JRuby version for testing
16+
gem 'jruby-jars', '~> ' + JRUBY_VERSION.split('.')[0..1].join('.')
1017
end

Mavenfile

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,19 @@
55
gemspec( :jar => 'warbler_jar.jar',
66
:source => 'ext' )
77

8-
properties( 'jruby.plugins.version' => '2.0.1',
9-
'jruby.version' => '9.2.21.0',
8+
plugin_repository( :url => 'https://central.sonatype.com/repository/maven-snapshots/',
9+
:id => 'central-snapshots' ) do
10+
releases 'false'
11+
snapshots 'true'
12+
end
13+
repository( :url => 'https://central.sonatype.com/repository/maven-snapshots/',
14+
:id => 'central-snapshots' ) do
15+
releases 'false'
16+
snapshots 'true'
17+
end
18+
19+
properties( 'jruby.plugins.version' => '3.0.6',
20+
'jruby.version' => '9.4.13.0',
1021
'jetty.version' => '9.4.31.v20200723' )
1122

1223
# dependencies needed for compilation
@@ -15,15 +26,15 @@ scope :provided do
1526
jar 'org.eclipse.jetty:jetty-webapp', '${jetty.version}'
1627
end
1728

18-
plugin :compiler, '3.1', :source => '1.6', :target => '1.6'
29+
plugin :compiler, '3.1', :source => '8', :target => '8'
1930

2031
plugin :invoker, '1.8' do
2132
execute_goals( :install, :run,
2233
:id => 'integration-test',
2334
:properties => { 'warbler.version' => '${project.version}',
2435
'jruby.version' => '${jruby.version}',
2536
'jetty.version' => '${jetty.version}',
26-
'bundler.version' => '1.12.5',
37+
'bundler.version' => '2.6.3',
2738
'jruby.plugins.version' => '${jruby.plugins.version}' },
2839

2940
:goals => ['verify'],

Rakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ task :default => :spec
2828
# use Mavenfile to define :jar task
2929
require 'maven/ruby/maven'
3030
mvn = Maven::Ruby::Maven.new
31+
mvn << '--no-transfer-progress'
32+
3133
if defined?(JRUBY_VERSION) && !JRUBY_VERSION.start_with?('9.0')
3234
mvn.inherit_jruby_version
3335
end

integration/pom.xml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
<packaging>pom</packaging>
99

1010
<properties>
11-
<jruby.plugins.version>1.1.5</jruby.plugins.version>
11+
<jruby.plugins.version>3.0.6</jruby.plugins.version>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<jruby.version>9.1.6.0</jruby.version>
13+
<jruby.version>9.4.13.0</jruby.version>
1414
<warbler.version>2.0.4</warbler.version>
15-
<bundler.version>1.12.5</bundler.version>
15+
<bundler.version>2.6.3</bundler.version>
1616
<gem.home>${basedir}/../../pkg/rubygems</gem.home>
1717
<gem.path>${basedir}/../../pkg/rubygems</gem.path>
1818
</properties>
1919

2020
<repositories>
2121
<repository>
22-
<id>rubygems-releases</id>
23-
<url>http://rubygems-proxy.torquebox.org/releases</url>
22+
<id>rubygems</id>
23+
<url>mavengem:https://rubygems.org</url>
2424
</repository>
2525
</repositories>
2626

@@ -52,6 +52,13 @@
5252
</dependencies>
5353

5454
<build>
55+
<extensions>
56+
<extension>
57+
<groupId>org.jruby.maven</groupId>
58+
<artifactId>mavengem-wagon</artifactId>
59+
<version>2.0.2</version>
60+
</extension>
61+
</extensions>
5562
<defaultGoal>verify</defaultGoal>
5663
<resources>
5764
<resource>
@@ -73,7 +80,7 @@
7380
</executions>
7481
</plugin>
7582
<plugin>
76-
<groupId>de.saumya.mojo</groupId>
83+
<groupId>org.jruby.maven</groupId>
7784
<artifactId>gem-maven-plugin</artifactId>
7885
<version>${jruby.plugins.version}</version>
7986
<executions>
@@ -89,8 +96,8 @@
8996
<groupId>org.apache.maven.plugins</groupId>
9097
<artifactId>maven-compiler-plugin</artifactId>
9198
<configuration>
92-
<source>1.7</source>
93-
<target>1.7</target>
99+
<source>8</source>
100+
<target>8</target>
94101
</configuration>
95102
</plugin>
96103
<plugin>
@@ -129,7 +136,7 @@
129136
<version>1.2.1</version>
130137
</plugin>
131138
<plugin>
132-
<groupId>de.saumya.mojo</groupId>
139+
<groupId>org.jruby.maven</groupId>
133140
<artifactId>jruby-maven-plugin</artifactId>
134141
<version>${jruby.plugins.version}</version>
135142
<configuration>

integration/rails4_test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<build>
1717
<plugins>
1818
<plugin>
19-
<groupId>de.saumya.mojo</groupId>
19+
<groupId>org.jruby.maven</groupId>
2020
<artifactId>jruby-maven-plugin</artifactId>
2121
<executions>
2222
<execution>

integration/runnable_test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</executions>
4545
</plugin>
4646
<plugin>
47-
<groupId>de.saumya.mojo</groupId>
47+
<groupId>org.jruby.maven</groupId>
4848
<artifactId>jruby-maven-plugin</artifactId>
4949
<executions>
5050
<execution>

integration/runnable_w_bundler_test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</executions>
4545
</plugin>
4646
<plugin>
47-
<groupId>de.saumya.mojo</groupId>
47+
<groupId>org.jruby.maven</groupId>
4848
<artifactId>jruby-maven-plugin</artifactId>
4949
<executions>
5050
<execution>

integration/simple_rack_test/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<build>
1717
<plugins>
1818
<plugin>
19-
<groupId>de.saumya.mojo</groupId>
19+
<groupId>org.jruby.maven</groupId>
2020
<artifactId>jruby-maven-plugin</artifactId>
2121
<executions>
2222
<execution>

lib/warbler/jar.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def jrubyc_options(config)
8888
private :jrubyc_options
8989

9090
def java_version(config)
91-
config.bytecode_version ? "-Djava.specification.version=#{config.bytecode_version}" : ''
91+
config.bytecode_version ? "-Djruby.bytecode.version=#{config.bytecode_version}" : ''
9292
end
9393

9494
def replace_compiled_ruby_files(config, compiled_ruby_files)
@@ -285,7 +285,7 @@ def add_with_pathmaps(config, f, map_type)
285285

286286
def expand_erb(file, config)
287287
require 'erb'
288-
erb = ERB.new(File.read(file), nil, '-')
288+
erb = ERB.new(File.read(file), trim_mode: '-')
289289
StringIO.new(erb.result(erb_binding(config)))
290290
end
291291

0 commit comments

Comments
 (0)