Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linux builds #872

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ The dependencies are minimal: you may use JLine without any dependency on *nix s
You can also use fine grained jars:
* `jline-terminal`: the `Terminal` api and implementations
* `jline-terminal-jansi`: terminal implementations leveraging the `Jansi` library
* `jline-terminal-jni`: terminal implementations leveraging the JNI native library
* `jline-terminal-jna`: terminal implementations leveraging the `JNA` library
* `jline-terminal-ffm`: terminal implementations leveraging the Foreign Functions & Mapping layer
* `jline-native`: the native library
* `jline-reader`: the line reader (including completion, history, etc...)
* `jline-style`: styling api
* `jline-remote-ssh`: helpers for using jline with [Mina SSHD](http://mina.apache.org/sshd-project/)
Expand Down
148 changes: 74 additions & 74 deletions demo/jline-repl.bat
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
@echo off
set DIRNAME=%~dp0%
set ROOTDIR=%DIRNAME%\..
set TARGETDIR=%DIRNAME%target
rem initialization
if not exist %TARGETDIR%\lib (
echo Build jline with maven before running the demo
goto END
)
goto :SETUP_CLASSPATH
: APPEND_TO_CLASSPATH
set filename=%~1
set cp=%cp%;%TARGETDIR%\lib\%filename%
goto :EOF
:SETUP_CLASSPATH
set cp=%TARGETDIR%\classes
rem JLINE
pushd %TARGETDIR%\lib
for %%G in (jline-*.jar) do call:APPEND_TO_CLASSPATH %%G
rem Groovy
for %%G in (groovy-*.jar) do call:APPEND_TO_CLASSPATH %%G
for %%G in (ivy-*.jar) do call:APPEND_TO_CLASSPATH %%G
set "opts=%JLINE_OPTS%"
set "logconf=%DIRNAME%etc\logging.properties"
:RUN_LOOP
if "%1" == "jansi" goto :EXECUTE_JANSI
if "%1" == "jna" goto :EXECUTE_JNA
if "%1" == "debug" goto :EXECUTE_DEBUG
if "%1" == "debugs" goto :EXECUTE_DEBUGS
if "%1" == "verbose" goto :EXECUTE_VERBOSE
if "%1" == "" goto :EXECUTE_MAIN
set "opts=%opts% %~1"
shift
goto :RUN_LOOP
:EXECUTE_JANSI
for %%G in (jansi-*.jar) do call:APPEND_TO_CLASSPATH %%G
shift
goto :RUN_LOOP
:EXECUTE_JNA
for %%G in (jna-*.jar) do call:APPEND_TO_CLASSPATH %%G
shift
goto :RUN_LOOP
:EXECUTE_DEBUG
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
shift
goto :RUN_LOOP
:EXECUTE_DEBUGS
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
shift
goto :RUN_LOOP
:EXECUTE_VERBOSE
set "logconf=%DIRNAME%etc\logging-verbose.properties"
shift
goto :RUN_LOOP
:EXECUTE_MAIN
popd
rem Launching Groovy REPL...
echo Launching Groovy REPL...
echo Classpath: %cp%
java -cp %cp% %opts% -Dgosh.home=%DIRNAME% -Djava.util.logging.config.file=%logconf% org.jline.demo.Repl
@echo off

set DIRNAME=%~dp0%
set ROOTDIR=%DIRNAME%\..
set TARGETDIR=%DIRNAME%target

rem initialization
if not exist %TARGETDIR%\lib (
echo Build jline with maven before running the demo
goto END
)

goto :SETUP_CLASSPATH

: APPEND_TO_CLASSPATH
set filename=%~1
set cp=%cp%;%TARGETDIR%\lib\%filename%
goto :EOF

:SETUP_CLASSPATH
set cp=%TARGETDIR%\classes
rem JLINE
pushd %TARGETDIR%\lib
for %%G in (jline-*.jar) do call:APPEND_TO_CLASSPATH %%G
rem Groovy
for %%G in (groovy-*.jar) do call:APPEND_TO_CLASSPATH %%G
for %%G in (ivy-*.jar) do call:APPEND_TO_CLASSPATH %%G

set "opts=%JLINE_OPTS%"
set "logconf=%DIRNAME%etc\logging.properties"
:RUN_LOOP
if "%1" == "jansi" goto :EXECUTE_JANSI
if "%1" == "jna" goto :EXECUTE_JNA
if "%1" == "debug" goto :EXECUTE_DEBUG
if "%1" == "debugs" goto :EXECUTE_DEBUGS
if "%1" == "verbose" goto :EXECUTE_VERBOSE
if "%1" == "" goto :EXECUTE_MAIN
set "opts=%opts% %~1"
shift
goto :RUN_LOOP

:EXECUTE_JANSI
for %%G in (jansi-*.jar) do call:APPEND_TO_CLASSPATH %%G
shift
goto :RUN_LOOP

:EXECUTE_JNA
for %%G in (jna-*.jar) do call:APPEND_TO_CLASSPATH %%G
shift
goto :RUN_LOOP

:EXECUTE_DEBUG
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
shift
goto :RUN_LOOP

:EXECUTE_DEBUGS
set "opts=%opts% -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
shift
goto :RUN_LOOP

:EXECUTE_VERBOSE
set "logconf=%DIRNAME%etc\logging-verbose.properties"
shift
goto :RUN_LOOP

:EXECUTE_MAIN
popd

rem Launching Groovy REPL...
echo Launching Groovy REPL...
echo Classpath: %cp%
java -cp %cp% %opts% -Dgosh.home=%DIRNAME% -Djava.util.logging.config.file=%logconf% org.jline.demo.Repl

:END
4 changes: 4 additions & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<groupId>org.jline</groupId>
<artifactId>jline-terminal-ffm</artifactId>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jni</artifactId>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
Expand Down
21 changes: 21 additions & 0 deletions jline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
<artifactId>jline-terminal</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jni</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
Expand Down Expand Up @@ -139,6 +144,14 @@
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jni</artifactId>
<classifier>sources</classifier>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
Expand Down Expand Up @@ -213,6 +226,14 @@
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
<excludes>**/*.class</excludes>
</artifactItem>
<artifactItem>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jni</artifactId>
<type>jar</type>
<overWrite>false</overWrite>
<outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
<excludes>**/*.class</excludes>
</artifactItem>
<artifactItem>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jansi</artifactId>
Expand Down
18 changes: 14 additions & 4 deletions native/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ linux-armv6-digest:=@sha256:7bad6ab302af34bdf6634c8c2b02c8dc6ac932c67da9ecc199c5
linux-x86-digest:=:latest
windows-static-x86-digest:=@sha256:99d7069789560ef77a7504ead4a2b5e3c245cb45a45f964c74fecbf649398d3a
windows-static-x64-digest:=@sha256:f159861bc80b29e5dafb223477167bec53ecec6cdacb051d31e90c5823542100
windows-arm64-digest:=@sha256:f4b3c1a49ec8b53418cef1499dc3f9a54a5570b7a3ecdf42fc8c83eb94b01b7d
cross-build-digest:=@sha256:8dbaa86462270db93ae1b1b319bdd88d89272faf3a68632daf4fa36b414a326e
freebsd-crossbuild-digest:=@sha256:cda62697a15d8bdc0bc26e780b1771ee78f12c55e7d5813e62c478af5a747c43
mcandre-snek-digest:=@sha256:9f84e9fcdf66daafc1f1c3fb772a6c97977714e17800aeac2e3bbe5dc5039dd0
Expand Down Expand Up @@ -68,9 +69,9 @@ $(JLINENATIVE_OUT)/%.o: src/main/native/%.c
ifeq ($(OS_NAME), Windows)
$(JLINENATIVE_OUT)/$(LIBNAME): ducible
endif
$(JLINENATIVE_OUT)/$(LIBNAME): $(JLINENATIVE_OUT)/jlinenative.o
$(JLINENATIVE_OUT)/$(LIBNAME): $(JLINENATIVE_OUT)/jlinenative.o $(JLINENATIVE_OUT)/clibrary.o $(JLINENATIVE_OUT)/kernel32.o
@mkdir -p $(@D)
$(CC) $(CCFLAGS) -o $@ $(JLINENATIVE_OUT)/jlinenative.o $(LINKFLAGS)
$(CC) $(CCFLAGS) -o $@ $(JLINENATIVE_OUT)/jlinenative.o $(JLINENATIVE_OUT)/clibrary.o $(JLINENATIVE_OUT)/kernel32.o $(LINKFLAGS)
ifeq ($(OS_NAME), Windows)
target/ducible/ducible $(JLINENATIVE_OUT)/$(LIBNAME)
endif
Expand All @@ -81,8 +82,11 @@ NATIVE_DLL:=$(NATIVE_DIR)/$(LIBNAME)

# For cross-compilation, install docker. See also https://github.com/dockcross/dockcross
# Disabled linux-armv6 build because of this issue; https://github.com/dockcross/dockcross/issues/190
native-all: linux-x86 linux-x86_64 linux-arm linux-armv6 linux-armv7 \
linux-arm64 linux-ppc64 win-x86 win-x86_64 mac-x86 mac-x86_64 mac-arm64 freebsd-x86 freebsd-x86_64
native-all: \
linux-x86 linux-x86_64 linux-arm linux-armv6 linux-armv7 linux-arm64 linux-ppc64 linux-riscv64 \
win-x86 win-x86_64 win-arm64 \
mac-x86 mac-x86_64 mac-arm64 \
freebsd-x86 freebsd-x86_64

native: $(NATIVE_DLL)

Expand Down Expand Up @@ -139,6 +143,12 @@ target/dockcross/dockcross-windows-static-x64: dockcross
win-x86_64: download-includes target/dockcross/dockcross-windows-static-x64
target/dockcross/dockcross-windows-static-x64 bash -c 'make clean-native native CROSS_PREFIX=x86_64-w64-mingw32.static- OS_NAME=Windows OS_ARCH=x86_64'

target/dockcross/dockcross-windows-arm64: dockcross
docker run --rm dockcross/windows-arm64$(windows-arm64-digest) > target/dockcross/dockcross-windows-arm64
chmod +x target/dockcross/dockcross-windows-arm64
win-arm64: download-includes target/dockcross/dockcross-windows-arm64
target/dockcross/dockcross-windows-arm64 bash -c 'make clean-native native CROSS_PREFIX=aarch64-w64-mingw32- OS_NAME=Windows OS_ARCH=arm64'

mac-x86: download-includes
docker run -it --rm -v $$PWD:/workdir --user $$(id -u):$$(id -g) \
-e CROSS_TRIPLE=i386-apple-darwin multiarch/crossbuild$(cross-build-digest) make clean-native native OS_NAME=Mac OS_ARCH=x86
Expand Down
Loading