Skip to content

Commit 98ff6e1

Browse files
authored
Merge branch 'master' into fixstreams
2 parents b29ff63 + f44d59a commit 98ff6e1

File tree

57 files changed

+6943
-738
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6943
-738
lines changed

.github/workflows/main.yml

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ on:
5151
- v3.5
5252
- v3.4
5353
- v3.3
54+
- ios-2024_2
5455
pull_request:
5556
release:
5657
types: [published]
@@ -94,22 +95,80 @@ jobs:
9495
**/build/reports/**
9596
**/build/changed-images/**
9697
**/build/test-results/**
98+
99+
# Build iOS natives
100+
BuildIosNatives:
101+
name: Build natives for iOS
102+
runs-on: macOS-14
103+
104+
steps:
105+
- name: Check default JAVAs
106+
run: echo $JAVA_HOME --- $JAVA_HOME_8_X64 --- $JAVA_HOME_11_X64 --- $JAVA_HOME_17_X64 --- $JAVA_HOME_21_X64 ---
107+
108+
- name: Setup the java environment
109+
uses: actions/setup-java@v4
110+
with:
111+
distribution: 'temurin'
112+
java-version: '11.0.26+4'
113+
114+
- name: Setup the XCode version to 15.1.0
115+
uses: maxim-lobanov/setup-xcode@v1
116+
with:
117+
xcode-version: '15.1.0'
118+
119+
- name: Clone the repo
120+
uses: actions/checkout@v4
121+
with:
122+
fetch-depth: 1
123+
124+
- name: Validate the Gradle wrapper
125+
uses: gradle/actions/wrapper-validation@v3
126+
127+
- name: Build
128+
run: |
129+
./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
130+
:jme3-ios-native:build
131+
132+
- name: Upload natives
133+
uses: actions/upload-artifact@master
134+
with:
135+
name: ios-natives
136+
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework
137+
97138
# Build the natives on android
98139
BuildAndroidNatives:
99140
name: Build natives for android
100141
runs-on: ubuntu-latest
101142
container:
102-
image: jmonkeyengine/buildenv-jme3:android
143+
image: ghcr.io/cirruslabs/android-sdk:36-ndk
103144

104145
steps:
105146
- name: Clone the repo
106147
uses: actions/checkout@v4
107148
with:
108149
fetch-depth: 1
150+
151+
- name: Setup Java 11
152+
uses: actions/setup-java@v4
153+
with:
154+
distribution: temurin
155+
java-version: '11'
156+
157+
- name: Check java version
158+
run: java -version
159+
160+
- name: Install CMake
161+
run: |
162+
apt-get update
163+
apt-get install -y cmake
164+
cmake --version
165+
109166
- name: Validate the Gradle wrapper
110167
uses: gradle/actions/wrapper-validation@v3
168+
111169
- name: Build
112170
run: |
171+
export ANDROID_NDK="$ANDROID_SDK_ROOT/ndk/$ANDROID_NDK_VERSION"
113172
./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
114173
:jme3-android-native:assemble
115174
@@ -121,7 +180,7 @@ jobs:
121180

122181
# Build the engine, we only deploy from ubuntu-latest jdk21
123182
BuildJMonkey:
124-
needs: [BuildAndroidNatives]
183+
needs: [BuildAndroidNatives, BuildIosNatives]
125184
name: Build on ${{ matrix.osName }} jdk${{ matrix.jdk }}
126185
runs-on: ${{ matrix.os }}
127186
strategy:
@@ -162,6 +221,12 @@ jobs:
162221
name: android-natives
163222
path: build/native
164223

224+
- name: Download natives for iOS
225+
uses: actions/download-artifact@master
226+
with:
227+
name: ios-natives
228+
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework
229+
165230
- name: Validate the Gradle wrapper
166231
uses: gradle/actions/wrapper-validation@v3
167232
- name: Build Engine
@@ -354,6 +419,12 @@ jobs:
354419
name: android-natives
355420
path: build/native
356421

422+
- name: Download natives for iOS
423+
uses: actions/download-artifact@master
424+
with:
425+
name: ios-natives
426+
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework
427+
357428
- name: Rebuild the maven artifacts and upload them to Sonatype's maven-snapshots repo
358429
run: |
359430
if [ "${{ secrets.CENTRAL_PASSWORD }}" = "" ];
@@ -411,6 +482,12 @@ jobs:
411482
name: android-natives
412483
path: build/native
413484

485+
- name: Download natives for iOS
486+
uses: actions/download-artifact@master
487+
with:
488+
name: ios-natives
489+
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework
490+
414491
- name: Rebuild the maven artifacts and upload them to Sonatype's Central Publisher Portal
415492
run: |
416493
if [ "${{ secrets.CENTRAL_PASSWORD }}" = "" ];

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jMonkeyEngine
44
[![Build Status](https://github.com/jMonkeyEngine/jmonkeyengine/workflows/Build%20jMonkeyEngine/badge.svg)](https://github.com/jMonkeyEngine/jmonkeyengine/actions)
55

66
jMonkeyEngine is a 3-D game engine for adventurous Java developers. It’s open-source, cross-platform, and cutting-edge.
7-
v3.7.0 is the latest stable version of the engine.
7+
v3.8.0 is the latest stable version of the engine.
88

99
The engine is used by several commercial game studios and computer-science courses. Here's a taste:
1010

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/Application.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@
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
40+
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true
41+
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
APP_PLATFORM := android-9
22
APP_OPTIM := release
3-
APP_ABI := all
3+
APP_ABI := armeabi-v7a,arm64-v8a,x86,x86_64
4+
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true
5+

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)