Skip to content

Commit eb17ccb

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

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:
@@ -35,7 +35,7 @@ jobs:
3535
cache: maven
3636

3737
- name: Build with Maven
38-
run: ./mvnw -B install -Djruby.version=${{ matrix.jruby_version }}
38+
run: ./mvnw -B install -Djruby.test.version=${{ matrix.jruby_version }}
3939
env:
4040
RACK_VERSION: ${{ matrix.rack_version }}
4141

@@ -73,7 +73,6 @@ jobs:
7373

7474
env:
7575
BUNDLE_GEMFILE: gemfiles/${{ matrix.appraisal }}.gemfile
76-
JRUBY_VERSION: ${{ matrix.jruby_version }}
7776

7877
steps:
7978
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

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>
@@ -78,7 +82,7 @@
7882
<!-- This has to be jruby-complete, as bundler-maven-plugin has special logic to exclude jruby-complete - otherwise
7983
it conflicts with the bootclasspath if using different "target compile version" to "runtime version" -->
8084
<artifactId>jruby-complete</artifactId>
81-
<version>${jruby.version}</version>
85+
<version>${jruby.compat.version}</version>
8286
<scope>provided</scope>
8387
</dependency>
8488
<dependency>
@@ -236,7 +240,7 @@
236240
<phase>test</phase>
237241
<goals><goal>install</goal></goals>
238242
<configuration>
239-
<jrubyVersion>${jruby.version}</jrubyVersion>
243+
<jrubyVersion>${jruby.test.version}</jrubyVersion>
240244
<local>false</local>
241245
<quiet>false</quiet>
242246
</configuration>
@@ -248,7 +252,7 @@
248252
<artifactId>rake-maven-plugin</artifactId>
249253
<version>${jruby.maven.plugins.version}</version>
250254
<configuration>
251-
<jrubyVersion>${jruby.version}</jrubyVersion>
255+
<jrubyVersion>${jruby.test.version}</jrubyVersion>
252256
</configuration>
253257
<executions>
254258
<execution>

0 commit comments

Comments
 (0)