Skip to content

Commit

Permalink
Upgrade to latest jline release and enable the gogo-build
Browse files Browse the repository at this point in the history
Currently gogo-jline uses a rather outdated jline release, this upgrades
to the latest release and enables the build.
  • Loading branch information
Christoph Läubrich committed Mar 6, 2025
1 parent 9df1f5d commit f268a41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
paths:
- 'scr/**'
- 'http/**'
- 'gogo/**'
- 'tools/maven-bundle-plugin/**'
- 'tools/osgicheck-maven-plugin/**'
- 'webconsole/**'
Expand Down Expand Up @@ -44,6 +45,8 @@ jobs:
- 'scr/**'
http:
- 'http/**'
gogo:
- 'gogo/**'
maven-bundle-plugin:
- 'tools/maven-bundle-plugin/**'
maven-osgicheck-plugin:
Expand All @@ -65,6 +68,9 @@ jobs:
- name: Felix Webconsole
if: steps.changes.outputs.webconsole == 'true'
run: mvn -B -V -Dstyle.color=always --file webconsole/pom.xml clean install verify
- name: Felix Gogo Shell
if: steps.changes.outputs.gogo == 'true'
run: mvn -B -V -Dstyle.color=always --file gogo/pom.xml clean install verify
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
Expand Down
4 changes: 2 additions & 2 deletions gogo/jline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<version>3.13.2</version>
<version>3.29.0</version>
</dependency>
<dependency>
<groupId>org.apache.sshd</groupId>
Expand Down Expand Up @@ -94,7 +94,7 @@
</Export-Package>
<Import-Package>
!org.apache.felix.gogo.runtime.threadio,
org.jline*;version="[3.13,4)",
org.jline*;version="[3.29,4)",
*
</Import-Package>
</instructions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
*/
package org.apache.felix.gogo.jline;

import static org.apache.felix.gogo.jline.Shell.getCommands;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayInputStream;
Expand Down Expand Up @@ -49,12 +51,12 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.felix.service.command.Job;
import org.apache.felix.service.command.Process;
import org.apache.felix.gogo.runtime.CommandSessionImpl;
import org.apache.felix.service.command.CommandSession;
import org.apache.felix.service.command.Converter;
import org.apache.felix.service.command.Function;
import org.apache.felix.service.command.Job;
import org.apache.felix.service.command.Process;
import org.jline.builtins.Commands;
import org.jline.builtins.Completers.DirectoriesCompleter;
import org.jline.builtins.Completers.FilesCompleter;
Expand All @@ -64,8 +66,7 @@
import org.jline.reader.ParsedLine;
import org.jline.reader.Widget;
import org.jline.terminal.Terminal;

import static org.apache.felix.gogo.jline.Shell.getCommands;
import org.jline.utils.StyleResolver;

/**
* gosh built-in commands.
Expand Down Expand Up @@ -683,7 +684,7 @@ public List<Candidate> __files(CommandSession session) {
List<Candidate> candidates = new ArrayList<>();
new FilesCompleter(session.currentDir()) {
@Override
protected String getDisplay(Terminal terminal, Path p) {
protected String getDisplay(Terminal terminal, Path p, StyleResolver resolver, String separator) {
return getFileDisplay(session, p);
}
}.complete(reader, line, candidates);
Expand All @@ -696,7 +697,7 @@ public List<Candidate> __directories(CommandSession session) {
List<Candidate> candidates = new ArrayList<>();
new DirectoriesCompleter(session.currentDir()) {
@Override
protected String getDisplay(Terminal terminal, Path p) {
protected String getDisplay(Terminal terminal, Path p, StyleResolver resolver, String separator) {
return getFileDisplay(session, p);
}
}.complete(reader, line, candidates);
Expand Down

0 comments on commit f268a41

Please sign in to comment.