Skip to content

Commit

Permalink
Update JRuby to 9.4.3.0
Browse files Browse the repository at this point in the history
A few minor tweaks were needed here to make this work properly.
Part of work to get mavengem updated and working with the new
RubyGems.org API (jruby/mavengem#9).

For the gem installer change background, see rubygems/rubygems@de3f8d0

For the bold/escape change, see jruby/jruby#7864
  • Loading branch information
headius committed Jul 20, 2023
1 parent 3dc6f0b commit 90c2f80
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<artifactItem>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
<outputDirectory>${project.build.directory}</outputDirectory>
</artifactItem>
</artifactItems>
Expand Down Expand Up @@ -116,7 +116,7 @@
<configuration>
<arguments>
<argument>-cp</argument>
<argument>${project.build.directory}/jruby-complete-9.2.19.0.jar${path.separator}${project.build.directory}/gems-test-0.0.0.jar</argument>
<argument>${project.build.directory}/jruby-complete-9.4.3.0.jar${path.separator}${project.build.directory}/gems-test-0.0.0.jar</argument>
<argument>org.jruby.Main</argument>
<argument>-e</argument>
<argument>
Expand All @@ -138,7 +138,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
<type>jar</type>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
</dependency>
</dependencies>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
</dependency>
</dependencies>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion gem-proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>9.2.19.0</version>
<version>9.4.3.0</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class AbstractJRubyMojo extends AbstractMojo {

protected static final String JRUBY_STDLIB = "jruby-stdlib";

protected static final String DEFAULT_JRUBY_VERSION = "9.2.19.0";
protected static final String DEFAULT_JRUBY_VERSION = "9.4.3.0";


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jruby.versions=9.2.19.0
jruby.versions=9.4.3.0
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,8 @@ void getTeeClass(StringBuilder builder){
}

void getAddTestCases(StringBuilder builder){
builder.append("require 'rubygems'\n");
builder.append("begin\n");
builder.append(" require 'bundler'\n");
builder.append(" Bundler.require\n");
builder.append("rescue Exception\n");
builder.append(" begin\n");
builder.append(" gem 'minitest'\n");
builder.append(" rescue Exception\n");
builder.append(" # assume we run ruby19\n");
builder.append(" end\n");
builder.append("end\n");
builder.append("begin\n");
builder.append(" gem 'minitest'\n");
builder.append(" require 'minitest/autorun'\n");
builder.append("rescue\n");
builder.append(" raise 'looks like minitest gem is missing'\n");
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<invoker.skip>true</invoker.skip>
<maven.version>3.0.3</maven.version>
<jruby.version>9.2.19.0</jruby.version>
<jruby.version>9.4.3.0</jruby.version>
<jruby.rack.version>1.0.10</jruby.rack.version>
<jetty.version>7.5.1.v20110908</jetty.version>
<war.version>2.1.1</war.version>
Expand Down
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-path/test.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# to allow the verify script to work
jruby.version=9.2.19.0
jruby.version=9.4.3.0
2 changes: 1 addition & 1 deletion rspec-maven-plugin/src/it/rspec-path/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import org.codehaus.plexus.util.FileUtils;


String log = FileUtils.fileRead( new File( basedir, "build.log" ) );
String expected = "jruby-9.2.19.0 mode : 1 example, 0 failures";
String expected = "jruby-9.4.3.0 mode : 1 example, 0 failures";
if ( !log.contains( expected ) )
{
throw new RuntimeException( "log file does not contain '" + expected + "'" );
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jruby.versions=9.2.19.0
jruby.versions=9.4.3.0
3 changes: 1 addition & 2 deletions ruby-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
</dependency>
</dependencies>
<properties>
<jruby.versions>9.2.19.0</jruby.versions>
<jruby.18and19>true</jruby.18and19>
<jruby.versions>9.4.3.0</jruby.versions>
<plexus.version>1.5.4</plexus.version>
<root.dir>${basedir}/..</root.dir>
<gem.home>${root.dir}/target/rubygems</gem.home>
Expand Down
2 changes: 1 addition & 1 deletion ruby-tools/src/main/scripts/install_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'fileutils'

Dir[ 'target/dependency/*gem' ].each do |file|
installer = Gem::Installer.new( file,
installer = Gem::Installer.at( file,
:ignore_dependencies => true,
:install_dir => '../target/rubygems' )
installer.install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void should_execute_command_with_args_and_return_in_output_stream() throw
launcher.execute(Arrays.asList("-v"), outputStream);

final String output = outputStream.toString();
assertThat(output).startsWith("jruby 9.2.19.0 (2.5.8)");
assertThat(output).startsWith("jruby 9.4.3.0 (3.1.4)");
}

@Test
Expand All @@ -58,9 +58,15 @@ public void should_execute_command_with_args_and_return_in_file() throws IOExcep
String[] lines = output.split("\n");
assertThat(lines).hasSizeGreaterThan(3);
// -v line
assertThat(lines[0]).startsWith("jruby 9.2.19.0 (2.5.8)");
assertThat(lines[0]).startsWith("jruby 9.4.3.0 (3.1.4)");
// --help first
assertThat(lines[1]).isEqualTo("Usage: jruby [switches] [--] [programfile] [arguments]");
System.out.println(Arrays.toString(lines[1].getBytes()));
// JRuby 9.4.0.0 thru 9.4.3.0 always emit the escape sequence here (jruby/jruby#7864)
if (lines[1].startsWith("\033[1m")) {
assertThat(lines[1]).contains("jruby [switches] [--] [programfile] [arguments]");
} else {
assertThat(lines[1]).isEqualTo("Usage: jruby [switches] [--] [programfile] [arguments]");
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void should_execute_script_with_only_args_and_return_in_output_stream() t
.execute(outputStream);

final String output = outputStream.toString();
assertThat(output).startsWith("jruby 9.2.19.0 (2.5.8)");
assertThat(output).startsWith("jruby 9.4.3.0 (3.1.4)");
}

@Test
Expand All @@ -40,7 +40,7 @@ public void should_execute_script_with_only_args_and_return_in_file() throws Scr

byte[] fileBytes = Files.readAllBytes(outputFile.toPath());
final String output = new String(fileBytes, StandardCharsets.UTF_8);
assertThat(output).startsWith("jruby 9.2.19.0 (2.5.8)");
assertThat(output).startsWith("jruby 9.4.3.0 (3.1.4)");
}

@Test
Expand All @@ -49,7 +49,7 @@ public void should_return_jruby_version() throws ScriptException, IOException {

JRubyVersion version = gemScriptFactory.getVersion();

assertThat(version.getVersion()).isEqualTo("9.2.19.0");
assertThat(version.getLanguage()).isEqualTo("2.5.8");
assertThat(version.getVersion()).isEqualTo("9.4.3.0");
assertThat(version.getLanguage()).isEqualTo("3.1.4");
}
}
2 changes: 1 addition & 1 deletion runit-maven-plugin/src/it/runit-with-env/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<version>@project.version@</version>
<configuration>
<env><VERSION>123</VERSION></env>
<versions>9.2.19.0</versions>
<versions>9.4.3.0</versions>
</configuration>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
jruby.versions=9.2.19.0
jruby.versions=9.4.3.0

0 comments on commit 90c2f80

Please sign in to comment.