Skip to content

Commit e2957b2

Browse files
authored
Merge branch 'master' into capdevon-RenderManager
2 parents b86e37d + ab9af09 commit e2957b2

File tree

37 files changed

+801
-430
lines changed

37 files changed

+801
-430
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://jmonkeyengine.org/funding.json

.github/workflows/main.yml

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -59,62 +59,75 @@ jobs:
5959
ScreenshotTests:
6060
name: Run Screenshot Tests
6161
runs-on: ubuntu-latest
62+
container:
63+
image: ghcr.io/onemillionworlds/opengl-docker-image:v1
6264
permissions:
6365
contents: read
6466
steps:
65-
- uses: actions/checkout@v4
66-
- name: Set up JDK 17
67-
uses: actions/setup-java@v4
68-
with:
69-
java-version: '17'
70-
distribution: 'temurin'
71-
- name: Install Mesa3D
72-
run: |
73-
sudo apt-get update
74-
sudo apt-get install -y mesa-utils libgl1-mesa-dri libgl1 libglx-mesa0 xvfb
75-
- name: Set environment variables for Mesa3D
76-
run: |
77-
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
78-
echo "MESA_LOADER_DRIVER_OVERRIDE=llvmpipe" >> $GITHUB_ENV
79-
- name: Start xvfb
80-
run: |
81-
sudo Xvfb :99 -ac -screen 0 1024x768x16 &
82-
export DISPLAY=:99
83-
echo "DISPLAY=:99" >> $GITHUB_ENV
84-
- name: Verify Mesa3D Installation
85-
run: |
86-
glxinfo | grep "OpenGL"
87-
- name: Validate the Gradle wrapper
88-
uses: gradle/actions/wrapper-validation@v3
89-
- name: Test with Gradle Wrapper
90-
run: |
91-
./gradlew :jme3-screenshot-test:screenshotTest
92-
- name: Upload Test Reports
93-
uses: actions/upload-artifact@master
94-
if: always()
95-
with:
96-
name: screenshot-test-report
97-
retention-days: 30
98-
path: |
99-
**/build/reports/**
100-
**/build/changed-images/**
101-
**/build/test-results/**
67+
- uses: actions/checkout@v4
68+
- name: Start xvfb
69+
run: |
70+
Xvfb :99 -ac -screen 0 1024x768x16 &
71+
export DISPLAY=:99
72+
echo "DISPLAY=:99" >> $GITHUB_ENV
73+
- name: Report GL/Vulkan
74+
run: |
75+
set -x
76+
echo "DISPLAY=$DISPLAY"
77+
glxinfo | grep -E "OpenGL version|OpenGL renderer|OpenGL vendor" || true
78+
vulkaninfo --summary || true
79+
echo "VK_ICD_FILENAMES=$VK_ICD_FILENAMES"
80+
echo "MESA_LOADER_DRIVER_OVERRIDE=$MESA_LOADER_DRIVER_OVERRIDE"
81+
echo "GALLIUM_DRIVER=$GALLIUM_DRIVER"
82+
- name: Validate the Gradle wrapper
83+
uses: gradle/actions/wrapper-validation@v3
84+
- name: Test with Gradle Wrapper
85+
run: |
86+
./gradlew :jme3-screenshot-test:screenshotTest
87+
- name: Upload Test Reports
88+
uses: actions/upload-artifact@master
89+
if: always()
90+
with:
91+
name: screenshot-test-report
92+
retention-days: 30
93+
path: |
94+
**/build/reports/**
95+
**/build/changed-images/**
96+
**/build/test-results/**
10297
# Build the natives on android
10398
BuildAndroidNatives:
10499
name: Build natives for android
105100
runs-on: ubuntu-latest
106101
container:
107-
image: jmonkeyengine/buildenv-jme3:android
102+
image: ghcr.io/cirruslabs/android-sdk:35-ndk
108103

109104
steps:
110105
- name: Clone the repo
111106
uses: actions/checkout@v4
112107
with:
113108
fetch-depth: 1
109+
110+
- name: Setup Java 11
111+
uses: actions/setup-java@v4
112+
with:
113+
distribution: temurin
114+
java-version: '11'
115+
116+
- name: Check java version
117+
run: java -version
118+
119+
- name: Install CMake
120+
run: |
121+
apt-get update
122+
apt-get install -y cmake
123+
cmake --version
124+
114125
- name: Validate the Gradle wrapper
115126
uses: gradle/actions/wrapper-validation@v3
127+
116128
- name: Build
117129
run: |
130+
export ANDROID_NDK="$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION"
118131
./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
119132
:jme3-android-native:assemble
120133

.github/workflows/screenshot-test-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
contents: read
2222
steps:
2323
- name: Wait for GitHub to register the workflow run
24-
run: sleep 15
24+
run: sleep 120
2525

2626
- name: Wait for Screenshot Tests to complete
2727
uses: lewagon/wait-on-check-action@v1.3.1

jme3-android-native/openalsoft.gradle

Lines changed: 97 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// OpenAL Soft r1.21.1
22
// TODO: update URL to jMonkeyEngine fork once it's updated with latest kcat's changes
3-
String openALSoftUrl = 'https://github.com/kcat/openal-soft/archive/1.21.1.zip'
3+
String openALSoftUrl = 'https://github.com/kcat/openal-soft/archive/1.24.3.zip'
44
String openALSoftZipFile = 'OpenALSoft.zip'
55

66
// OpenAL Soft directory the download is extracted into
77
// Typically, the downloaded OpenAL Soft zip file will extract to a directory
88
// called "openal-soft"
9-
String openALSoftFolder = 'openal-soft-1.21.1'
9+
String openALSoftFolder = 'openal-soft-1.24.3'
1010

1111
//Working directories for the ndk build.
1212
String openalsoftBuildDir = "${buildDir}" + File.separator + 'openalsoft'
@@ -81,13 +81,103 @@ task copyJmeOpenALSoft(type: Copy, dependsOn: [copyOpenALSoft, copyJmeHeadersOpe
8181
from sourceDir
8282
into outputDir
8383
}
84+
// rootProject.ndkCommandPath must be set to your ndk-build wrapper or full ndk path
85+
def ndkPath = new File(rootProject.ndkCommandPath).getParent()
86+
def cmakeToolchain = "${ndkPath}/build/cmake/android.toolchain.cmake"
87+
88+
// 1) list your ABIs here
89+
def openalAbis = [
90+
"armeabi-v7a",
91+
"arm64-v8a",
92+
"x86",
93+
"x86_64"
94+
]
95+
96+
// 2) for each ABI, register a configure/build pair
97+
openalAbis.each { abi ->
98+
99+
// configure task
100+
tasks.register("configureOpenAlSoft_${abi}", Exec) {
101+
group = "external-native"
102+
description = "Generate CMake build files for OpenAL-Soft [$abi]"
103+
104+
workingDir file("$openalsoftBuildDir/$openALSoftFolder")
105+
commandLine = [
106+
"cmake",
107+
"-S", ".",
108+
"-B", "cmake-build-${abi}",
109+
"-G", "Unix Makefiles", // or Ninja
110+
"-DCMAKE_TOOLCHAIN_FILE=${cmakeToolchain}",
111+
"-DANDROID_PLATFORM=android-21",
112+
"-DANDROID_ABI=${abi}",
113+
"-DCMAKE_BUILD_TYPE=Release",
114+
"-DALSOFT_UTILS=OFF",
115+
"-DALSOFT_EXAMPLES=OFF",
116+
"-DALSOFT_TESTS=OFF",
117+
"-DALSOFT_BACKEND_OPENSL=ON",
118+
'-DALSOFT_SHARED=OFF',
119+
'-DBUILD_SHARED_LIBS=OFF',
120+
'-DALSOFT_STATIC=ON',
121+
'-DLIBTYPE=STATIC',
122+
'-DCMAKE_CXX_FLAGS=-stdlib=libc++'
123+
]
124+
125+
dependsOn copyOpenALSoft
126+
}
127+
128+
// build task
129+
tasks.register("buildOpenAlSoft_${abi}", Exec) {
130+
group = "external-native"
131+
description = "Compile OpenAL-Soft into libopenalsoft.a for [$abi]"
132+
133+
dependsOn "configureOpenAlSoft_${abi}"
134+
workingDir file("$openalsoftBuildDir/$openALSoftFolder")
135+
commandLine = [
136+
"cmake",
137+
"--build", "cmake-build-${abi}",
138+
"--config", "Release"
139+
]
140+
}
141+
}
142+
143+
// 3) optional: aggregate tasks
144+
tasks.register("configureOpenAlSoftAll") {
145+
group = "external-native"
146+
description = "Configure OpenAL-Soft for all ABIs"
147+
dependsOn openalAbis.collect { "configureOpenAlSoft_${it}" }
148+
}
149+
150+
tasks.register("buildOpenAlSoftAll") {
151+
group = "external-native"
152+
description = "Build OpenAL-Soft for all ABIs"
153+
dependsOn openalAbis.collect { "buildOpenAlSoft_${it}" }
154+
}
84155

85-
task buildOpenAlSoftNativeLib(type: Exec, dependsOn: copyJmeOpenALSoft) {
86-
// println "openalsoft build dir: " + openalsoftBuildDir
87-
// println "ndkCommandPath: " + project.ndkCommandPath
156+
task buildOpenAlSoftNativeLib(type: Exec) {
157+
group = "external-native"
158+
description = "Runs ndk-build on your JNI code, linking in the prebuilt OpenAL-Soft .a files"
159+
160+
dependsOn copyJmeOpenALSoft, buildOpenAlSoftAll
161+
162+
// where your Android.mk lives
88163
workingDir openalsoftBuildDir
164+
165+
// call the NDK build script
89166
executable rootProject.ndkCommandPath
90-
args "-j" + Runtime.runtime.availableProcessors()
167+
168+
// pass in all ABIs (so ndk-build will rebuild your shared .so for each one),
169+
// and pass in a custom var OPENALSOFT_BUILD_DIR so your Android.mk can find
170+
// the cmake-build-<ABI> folders.
171+
args(
172+
// let ndk-build know which ABIs to build for
173+
"APP_ABI=armeabi-v7a,arm64-v8a,x86,x86_64",
174+
175+
// pass in the path to the CMake output root
176+
"OPENALSOFT_BUILD_ROOT=${openalsoftBuildDir}/${openALSoftFolder}",
177+
178+
// parallel jobs
179+
"-j${Runtime.runtime.availableProcessors()}"
180+
)
91181
}
92182

93183
task updatePreCompiledOpenAlSoftLibs(type: Copy, dependsOn: buildOpenAlSoftNativeLib) {
@@ -140,3 +230,4 @@ class MyDownload extends DefaultTask {
140230
ant.get(src: sourceUrl, dest: target)
141231
}
142232
}
233+

jme3-android-native/src/native/jme_bufferallocator/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ LOCAL_PATH := $(call my-dir)
3939

4040
include $(CLEAR_VARS)
4141

42+
LOCAL_CFLAGS := -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true
4243
LOCAL_LDLIBS := -llog -Wl,-s
4344

4445
LOCAL_MODULE := bufferallocatorjme

jme3-android-native/src/native/jme_bufferallocator/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
APP_PLATFORM := android-19
3737
# change this to 'debug' to see android logs
3838
APP_OPTIM := release
39-
APP_ABI := all
39+
APP_ABI := armeabi-v7a,arm64-v8a,x86,x86_64

jme3-android-native/src/native/jme_decode/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LOCAL_C_INCLUDES:= \
1010
$(LOCAL_PATH) \
1111
$(LOCAL_PATH)/Tremor
1212

13-
LOCAL_CFLAGS := -std=gnu99 -DLIMIT_TO_64kHz -O0
13+
LOCAL_CFLAGS := -std=gnu99 -DLIMIT_TO_64kHz -O0 -DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true
1414
LOCAL_LDLIBS := -lz -llog -Wl,-s
1515

1616
ifeq ($(TARGET_ARCH),arm)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
APP_PLATFORM := android-9
22
APP_OPTIM := release
3-
APP_ABI := all
3+
APP_ABI := armeabi-v7a,arm64-v8a,x86,x86_64

jme3-android-native/src/native/jme_decode/com_jme3_audio_plugins_NativeVorbisFile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <unistd.h>
22
#include <stdlib.h>
33
#include <errno.h>
4+
#include <string.h>
45

56
#include "Tremor/ivorbisfile.h"
67

0 commit comments

Comments
 (0)