Skip to content

Commit 9c884d8

Browse files
committed
Migrate .java-version contents to .jruby.release
I think it makes more sense to use .jruby.release as the only file for version-specific details. This change may need to be tweaked to support JRuby 10 releases prior to 10.0.3.0 (assuming it is merged into that release), or it may not be important since we won't be changing the jruby.sh in any released artifacts. This version is a backport to 9.4.15.0.
1 parent 3a193f2 commit 9c884d8

3 files changed

Lines changed: 13 additions & 17 deletions

File tree

bin/.java-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/.jruby.release

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
JRUBY_VERSION=9.4.15.0-SNAPSHOT
22
JRUBY_MAIN=org.jruby.Main
3+
JRUBY_MINIMUM_JAVA_VERSION=8

bin/jruby.sh

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -555,16 +555,24 @@ if [ -f "$JAVA_HOME/release" ]; then
555555
esac
556556
fi
557557

558-
# Default java_runtime_version to $java_version
559-
: "${java_runtime_version:=$java_version}"
558+
# Get main class and version from .jruby.release
560559

561560
# shellcheck source=/dev/null
562-
if [ -f "$JRUBY_HOME/bin/.java-version" ] && . "$JRUBY_HOME/bin/.java-version" && [ "${JRUBY_MINIMUM_JAVA_VERSION-}" ]; then
561+
# shellcheck disable=2153 # Assigned in sourced file
562+
if [ -f "$jruby_release_file" ] && . "$jruby_release_file"; then
563+
java_class=$JRUBY_MAIN
564+
jruby_version=$JRUBY_VERSION
563565
minimum_java_version=$JRUBY_MINIMUM_JAVA_VERSION
564566
else
565-
# Only 9.4.12.0 and earlier will have shipped without a .java-version file, so fall back on minimum of 8
567+
# Only 9.4.14.0 and earlier will have shipped without a .jruby.release file, so fall back on 9.4 defaults
568+
java_class=org.jruby.Main
569+
jruby_version=unspecified
566570
minimum_java_version=8
567571
fi
572+
573+
# Default java_runtime_version to $java_version
574+
: "${java_runtime_version:=$java_version}"
575+
568576
add_log "Detected Java version: $java_version"
569577
add_log "Detected Java runtime version: $java_runtime_version"
570578

@@ -645,18 +653,6 @@ JAVA_OPTS="$JAVA_OPTS_TEMP"
645653

646654
CP_DELIMITER=":"
647655

648-
# Get main class and version from .jruby.release
649-
650-
# shellcheck source=/dev/null
651-
# shellcheck disable=2153 # Assigned in sourced file
652-
if [ -f "$jruby_release_file" ] && . "$jruby_release_file"; then
653-
java_class=$JRUBY_MAIN
654-
jruby_version=$JRUBY_VERSION
655-
else
656-
java_class=org.jruby.main
657-
jruby_version=unspecified
658-
fi
659-
660656
# Find main jruby jar and add it to the classpath
661657
jruby_jar=
662658
for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do

0 commit comments

Comments
 (0)