Skip to content

Commit e7b349e

Browse files
committed
[build] always compile against default jruby; but run tests with designated version
1 parent 915e375 commit e7b349e

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

.github/workflows/maven.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
env:
1010
# Default versions for canonical release build
1111
DEFAULT_JAVA_VERSION: '8'
12-
DEFAULT_JRUBY_VERSION: '9.4.14.0' # Should match pom.xml <jruby.version> property (AND a version inside the test matrix)
12+
DEFAULT_JRUBY_VERSION: '9.4.14.0' # Should match pom.xml <jruby.compat.version> property (AND a version inside the test matrix)
1313
DEFAULT_RACK_VERSION: '~> 2.2.0' # Should match Gemfile (AND a version inside the test matrix)
1414

1515
jobs:
@@ -42,7 +42,7 @@ jobs:
4242
cache: maven
4343

4444
- name: Build with Maven
45-
run: ./mvnw -B install -Djruby.version=${{ matrix.jruby_version }}
45+
run: ./mvnw -B install -Djruby.test.version=${{ matrix.jruby_version }}
4646
env:
4747
RACK_VERSION: ${{ matrix.rack_version }}
4848

@@ -79,7 +79,6 @@ jobs:
7979

8080
env:
8181
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
82-
JRUBY_VERSION: ${{ matrix.jruby_version }}
8382

8483
steps:
8584
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ directory 'target/classes'
3838

3939
desc "Compile classes"
4040
task(:compile => 'target/classes') do
41-
sh "./mvnw compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
41+
sh "./mvnw compile"
4242
end
4343

4444
directory 'target/test-classes'
4545

4646
desc "Compile test classes"
4747
task(:test_prepare => ['target/classes', 'target/test-classes']) do
48-
sh "./mvnw test-compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
48+
sh "./mvnw test-compile"
4949
end
5050

5151
desc "Unpack the rack gem"

pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
<properties>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2323

24-
<jruby.version>9.4.14.0</jruby.version>
24+
<!-- Version to target at compile time -->
25+
<jruby.compat.version>9.4.14.0</jruby.compat.version>
26+
<!-- Version to execute tests with -->
27+
<jruby.test.version>${jruby.compat.version}</jruby.test.version>
28+
2529
<jruby.maven.plugins.version>3.0.6</jruby.maven.plugins.version>
2630
<gem.home>${project.build.directory}/rubygems</gem.home>
2731
<slf4j.version>2.0.17</slf4j.version>
@@ -79,7 +83,7 @@
7983
<!-- This has to be jruby-complete, as bundler-maven-plugin has special logic to exclude jruby-complete - otherwise
8084
it conflicts with the bootclasspath if using different "target compile version" to "runtime version" -->
8185
<artifactId>jruby-complete</artifactId>
82-
<version>${jruby.version}</version>
86+
<version>${jruby.compat.version}</version>
8387
<scope>provided</scope>
8488
</dependency>
8589
<dependency>
@@ -243,7 +247,7 @@
243247
<phase>test</phase>
244248
<goals><goal>install</goal></goals>
245249
<configuration>
246-
<jrubyVersion>${jruby.version}</jrubyVersion>
250+
<jrubyVersion>${jruby.test.version}</jrubyVersion>
247251
<local>false</local>
248252
<quiet>false</quiet>
249253
</configuration>
@@ -255,7 +259,7 @@
255259
<artifactId>rake-maven-plugin</artifactId>
256260
<version>${jruby.maven.plugins.version}</version>
257261
<configuration>
258-
<jrubyVersion>${jruby.version}</jrubyVersion>
262+
<jrubyVersion>${jruby.test.version}</jrubyVersion>
259263
</configuration>
260264
<executions>
261265
<execution>

0 commit comments

Comments
 (0)