Skip to content
Draft
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
38 changes: 38 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM registry.fedoraproject.org/fedora:43

RUN dnf -y update && \
dnf -y install \
git curl unzip which procps-ng psmisc findutils \
alsa-lib alsa-plugins-pulseaudio \
pulseaudio-libs pulseaudio-utils \
# X + desktop
xorg-x11-server-Xvfb xterm dbus-x11 \
xfce-polkit \
xfce4-session xfce4-panel xfce4-settings xfce4-terminal thunar \
xfwm4 \
feh \
# VNC + web VNC
x11vnc novnc python3-websockify \
# Xpra + dependencies (xpra-html5 not in Fedora repos; installed below from source)
xpra python3-gobject python3-paramiko \
# OpenGL (Mesa) + GLVND + tools (glxinfo)
mesa-dri-drivers mesa-libGL mesa-libEGL mesa-libGLU \
libglvnd-glx libglvnd-egl \
glx-utils zip weston xorg-x11-server-Xwayland wayland-utils \
&& dnf clean all



ENV SDKMAN_DIR=/root/.sdkman
RUN curl -s "https://get.sdkman.io" | bash \
&& source "$SDKMAN_DIR/bin/sdkman-init.sh" \
&& sdk install java 25-tem \
&& sdk default java 25-tem

ENV JAVA_HOME=${SDKMAN_DIR}/candidates/java/current
ENV PATH=${JAVA_HOME}/bin:${PATH}


COPY assets/wallpaper.jpg /root/wallpaper.jpg
COPY assets/novnc-index.html /usr/share/novnc/index.html

14 changes: 14 additions & 0 deletions .devcontainer/assets/novnc-index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8" />
<meta http-equiv="refresh" content="15; url=/vnc.html?autoconnect=1&resize=scale&view_clip=1">
<title>noVNC</title>
</head>

<body>
<b>Warming up <a href="/vnc.html?autoconnect=1&resize=scale&view_clip=1">noVNC</a>... </b>
</body>

</html>
Binary file added .devcontainer/assets/wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "jME env (SERVER)",
"build": {
"dockerfile": "Dockerfile"
},

"forwardPorts": [6080],
"portsAttributes": {
"6080": {
"label": "jME Desktop (Xpra HTML5)",
"onAutoForward": "openBrowser"
},
"5900": {
"label": "VNC",
"onAutoForward": "ignore"
}
},
"containerEnv": {
"JME_DEV_ENVIRONMENT": "yesReally",
"LIBGL_ALWAYS_SOFTWARE": "1",
"MESA_LOADER_DRIVER_OVERRIDE": "llvmpipe",
"GALLIUM_DRIVER": "llvmpipe",
"WAYLAND_DISPLAY": "",
"WAYLAND_SOCKET": "",
"XDG_RUNTIME_DIR": "",
"GDK_BACKEND": "x11",
"SDL_BACKEND": "x11",
"GLFW_PLATFORM": "x11",
"DISPLAY": ":99"

},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"postStartCommand": "bash .devcontainer/scripts/start-desktop.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed",
"java.jdt.ls.java.home": "/root/.sdkman/candidates/java/25-tem/"
}

}
}
}
32 changes: 32 additions & 0 deletions .devcontainer/gpu-nvidia/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "jME env (NVIDIA)",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"mounts": [
"source=${localEnv:XDG_RUNTIME_DIR}/pulse/native,target=/tmp/pulse/native,type=bind",
"source=${localEnv:HOME}/.config/pulse/cookie,target=/tmp/pulse/cookie,type=bind,readonly"
],
"runArgs": [
"--gpus=all"
],
"containerEnv": {
"LIBGL_ALWAYS_SOFTWARE": "0",
"NVIDIA_VISIBLE_DEVICES": "all",
"NVIDIA_DRIVER_CAPABILITIES": "graphics,utility,compute",
"__GL_THREADED_OPTIMIZATIONS": "0",
"JME3_DIALOGS_FACTORY": "",
"PULSE_SERVER": "unix:/tmp/pulse/native",
"PULSE_COOKIE": "/tmp/pulse/cookie"
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed",
"java.jdt.ls.java.home": "/root/.sdkman/candidates/java/25-tem/"
}
}
}
}
31 changes: 31 additions & 0 deletions .devcontainer/gup-soft/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "jME env",
"build": {
"dockerfile": "../Dockerfile",
"context": ".."
},
"mounts": [
"source=${localEnv:XDG_RUNTIME_DIR}/pulse/native,target=/tmp/pulse/native,type=bind",
"source=${localEnv:HOME}/.config/pulse/cookie,target=/tmp/pulse/cookie,type=bind,readonly"
],
"runArgs": [
"--device=/dev/dri",
"--group-add=video",
"--group-add=render"
],
"containerEnv": {
"LIBGL_ALWAYS_SOFTWARE": "0",
"JME3_DIALOGS_FACTORY": "",
"PULSE_SERVER": "unix:/tmp/pulse/native",
"PULSE_COOKIE": "/tmp/pulse/cookie"
},
"postCreateCommand": "bash .devcontainer/scripts/setup.sh",
"customizations": {
"vscode": {
"settings": {
"workbench.colorTheme": "GitHub Dark Dimmed",
"java.jdt.ls.java.home": "/root/.sdkman/candidates/java/25-tem/"
}
}
}
}
8 changes: 8 additions & 0 deletions .devcontainer/scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail


# Optional: warm Gradle wrapper so first run is less painful
if [ -f ./gradlew ]; then
./gradlew --version || true
fi
97 changes: 97 additions & 0 deletions .devcontainer/scripts/start-desktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$JME_DEV_ENVIRONMENT" != "yesReally" ];
then
echo "Not running! This script is meant to be run in the jMonkeyEngine dev container environment, and may do unexpected things if run elsewhere."
exit 1
fi

export DISPLAY="${DISPLAY:-:99}"
unset WAYLAND_DISPLAY WAYLAND_SOCKET XDG_RUNTIME_DIR
export GDK_BACKEND=x11
export SDL_VIDEODRIVER=x11
export GLFW_PLATFORM=x11

# Fedora noVNC web root path
NOVNC_WEB="/usr/share/novnc"
if [ ! -d "$NOVNC_WEB" ]; then
echo "ERROR: noVNC web root not found at $NOVNC_WEB"
echo "Try checking where novnc installed files are:"
rpm -ql novnc | sed -n '1,120p' || true
exit 1
fi

# Start virtual X server
if ! pgrep -f "Xvfb ${DISPLAY}" >/dev/null 2>&1; then
nohup Xvfb "${DISPLAY}" -screen 0 1440x900x24 +extension GLX +render -noreset >/tmp/xvfb.log 2>&1 &
fi

# Start a dbus session (XFCE wants it)
if ! pgrep -u "$(id -u)" -f "dbus-daemon.*--session" >/dev/null 2>&1; then
# shellcheck disable=SC2046
eval "$(dbus-launch --sh-syntax)"
fi

# Start a PolicyKit agent to avoid XFCE PolicyKitAgent errors (if available)
start_polkit_agent() {
if command -v polkit-gnome-authentication-agent-1 >/dev/null 2>&1; then
nohup polkit-gnome-authentication-agent-1 >/tmp/polkit-agent.log 2>&1 &
return
fi
if command -v xfce-polkit >/dev/null 2>&1; then
nohup xfce-polkit >/tmp/xfce-polkit.log 2>&1 &
return
fi
if [ -x "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1" ]; then
nohup /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 >/tmp/polkit-agent.log 2>&1 &
return
fi
echo "No PolicyKit agent found; PolicyKit dialogs may show an error."
}

start_polkit_agent



if [ "$JME_DEV_ENVIRONMENT" != "yesReally" ];
then
echo "Not running! This script is meant to be run in the jMonkeyEngine dev container environment, and may do unexpected things if run elsewhere."
exit 1
fi

# Init home
mkdir -p "$HOME/.config" "$HOME/.cache" "$HOME/.local/share"


# Start window manager
if ! pgrep -u "$(id -u)" -x xfwm4 >/dev/null 2>&1; then
nohup xfwm4 --compositor=off --daemon >/tmp/xfwm4.log 2>&1 &
fi


# Start XFCE session
if ! pgrep -u "$(id -u)" -x xfce4-session >/dev/null 2>&1; then
nohup xfce4-session >/tmp/xfce4-session.log 2>&1 &
fi

# Set wallpaper
feh --no-fehbg --bg-fill "/root/wallpaper.jpg"

# Start PulseAudio for app sound forwarding (used by Xpra speaker stream).
if command -v pulseaudio >/dev/null 2>&1; then
if ! pgrep -u "$(id -u)" -x pulseaudio >/dev/null 2>&1; then
nohup pulseaudio --start >/tmp/pulseaudio.log 2>&1 || true
fi
fi

# Start VNC server (no password; fine for Codespaces)
if ! pgrep -f "x11vnc.*-rfbport 5900" >/dev/null 2>&1; then
nohup x11vnc -display "${DISPLAY}" -nopw -forever -shared -cursor arrow -rfbport 5900 \
-nowf -noxdamage -xwarppointer -noxrecord -noxfixes >/tmp/x11vnc.log 2>&1 &
fi

# Start noVNC (websockify)
if ! pgrep -f "websockify.*6080" >/dev/null 2>&1; then
python3 -m websockify --web="${NOVNC_WEB}" 6080 localhost:5900
fi

21 changes: 0 additions & 21 deletions .github/workflows/format.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ javadoc_deploy.pub
!.vscode/settings.json
!.vscode/JME_style.xml
!.vscode/extensions.json
!.vscode/java.code-snippets
joysticks-*.txt
13 changes: 8 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"recommendations": [
"vscjava.vscode-java-pack",
"slevesque.shader"
]
}
"recommendations": [
"vscjava.vscode-java-pack",
"slevesque.shader",
"ms-vscode-remote.remote-containers",
"GitHub.copilot-chat",
"ms-vscode.remote-server"
]
}
54 changes: 54 additions & 0 deletions .vscode/java.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{

"logger":{
"prefix":"logger",
"body": [
"private static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(${1:${TM_FILENAME_BASE}}.class.getName());"
],
"description":"Add java.util Logger"
},
"log":{
"prefix": "log",
"body":[
"if(logger.isLoggable(java.util.logging.Level.$1 )){\n\tlogger.log(java.util.logging.Level.$1, \"$2\");\n}"
],

},
"logfinest":{
"prefix": "logfinest",
"body":[
"logger.finest($1);"
]
},
"logfiner":{
"prefix": "logfiner",
"body":[
"logger.finer($1);"
]
},
"logfine":{
"prefix": "logfine",
"body":[
"logger.fine($1);"
]
},
"loginfo":{
"prefix": "loginfo",
"body":[
"logger.info($1);"
]
},
"logwarning":{
"prefix": "logwarning",
"body":[
"logger.warning($1);"
]
},
"logsevere":{
"prefix": "logsevere",
"body":[
"logger.severe($1);"
]
}

}
15 changes: 4 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.compile.nullAnalysis.mode": "automatic",
"java.refactor.renameFromFileExplorer": "prompt",
"java.format.settings.url": "./.vscode/JME_style.xml",
"editor.formatOnPaste": true,
"java.format.settings.url": "${workspaceFolder}/.vscode/JME_style.xml",
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "modifications" ,

"prettier.tabWidth": 4,
"prettier.printWidth": 110,
"prettier.enable": true,
"prettier.resolveGlobalModules": true
"editor.formatOnSave": false,
"editor.formatOnSaveMode": "modifications",
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Loading
Loading