Skip to content

iOS support #2411

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

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
28f509d
Update GLImageFormats.java
joliver82 May 17, 2018
71fcaa9
Merge remote-tracking branch 'upstream/master'
joliver82 May 23, 2018
4f8a2cc
Merge pull request #3 from jMonkeyEngine/master
joliver82 Nov 14, 2018
05db003
Merge pull request #4 from jMonkeyEngine/master
joliver82 Jun 1, 2019
18b431f
Modified JmeBatchRenderBackend to clear the inner buffer of the image…
Nov 19, 2019
38e330b
Merge pull request #5 from jMonkeyEngine/master
joliver82 Nov 20, 2019
f9282c1
First impl of testcasefor multiple atlases issue. Still missing to ad…
joliver82 Dec 19, 2019
9d8cbfa
Merge pull request #7 from jMonkeyEngine/master
joliver82 Mar 9, 2020
2a6ca82
Merge branch 'nifty-batch-fix' into master
joliver82 Mar 9, 2020
0569a0a
Merge remote-tracking branch 'upstream/master'
Jan 25, 2021
8a90e91
Manual merge pending stuff from jme3 base
Jan 25, 2021
1092b80
Manual merge
Jan 25, 2021
066ba48
Merge pull request #9 from jMonkeyEngine/master
joliver82 Feb 15, 2021
6a4b4d2
Merge pull request #10 from jMonkeyEngine/master
joliver82 Mar 16, 2021
2800a92
Merge branch 'jMonkeyEngine:master' into master
joliver82 Oct 7, 2024
35681f7
Added ios natives and quick check to try getting the jni.h path in gi…
Oct 7, 2024
c28746d
Getting jni.h
Oct 7, 2024
6401ac4
try building
Oct 7, 2024
7b916c4
Improved workflow
Oct 7, 2024
3f6482d
Changed to compile using oldest xcode and use lowest ios available in…
Oct 7, 2024
f35a2b4
Cleaned ios native project
Oct 9, 2024
b3dfd17
Added gradle for jme3-ios-native
Oct 9, 2024
8a9fc83
Added comment for missing ios native upload task in workflow
Oct 9, 2024
1d47d39
Fixed getPlatform for iOS
Oct 14, 2024
e627ffd
Missing import
Oct 14, 2024
8a5f6df
Changed lib build to release
Oct 24, 2024
f6f1af9
Added no-stack-check and no-stack-protector to avoid ___chkstk_darwin…
Oct 24, 2024
62f5398
Merge branch 'jMonkeyEngine:master' into master
joliver82 Apr 25, 2025
f29b26f
Merge branch 'master' into ios-2024_2
Apr 25, 2025
4402dc7
Updated xcode version, 14.3 is not available anymore in github actions
Apr 25, 2025
d79b8d7
Updated java 11 to be installed
Apr 25, 2025
cbb521b
Fixed typo in java version
Apr 25, 2025
699bc0f
Added upload and package ios-natives
Apr 25, 2025
66d1a47
Made engine depend on ios-natives
Apr 25, 2025
1d592f8
Try proper uploading ios-natives
Apr 25, 2025
acc5a91
updated workflow
Apr 25, 2025
effe3f2
Fixed publishing to maven
Apr 27, 2025
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
61 changes: 60 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ on:
- v3.5
- v3.4
- v3.3
- ios-2024_2
pull_request:
release:
types: [published]
Expand Down Expand Up @@ -99,6 +100,46 @@ jobs:
**/build/reports/**
**/build/changed-images/**
**/build/test-results/**

# Build iOS natives
BuildIosNatives:
name: Build natives for iOS
runs-on: macOS-14

steps:
- name: Check default JAVAs
run: echo $JAVA_HOME --- $JAVA_HOME_8_X64 --- $JAVA_HOME_11_X64 --- $JAVA_HOME_17_X64 --- $JAVA_HOME_21_X64 ---

- name: Setup the java environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11.0.26+4'

- name: Setup the XCode version to 15.1.0
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1.0'

- name: Clone the repo
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Build
run: |
./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
:jme3-ios-native:build

- name: Upload natives
uses: actions/upload-artifact@master
with:
name: ios-natives
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework

# Build the natives on android
BuildAndroidNatives:
name: Build natives for android
Expand Down Expand Up @@ -126,7 +167,7 @@ jobs:

# Build the engine, we only deploy from ubuntu-latest jdk21
BuildJMonkey:
needs: [BuildAndroidNatives]
needs: [BuildAndroidNatives, BuildIosNatives]
name: Build on ${{ matrix.osName }} jdk${{ matrix.jdk }}
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -167,6 +208,12 @@ jobs:
name: android-natives
path: build/native

- name: Download natives for iOS
uses: actions/download-artifact@master
with:
name: ios-natives
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework

- name: Validate the Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Build Engine
Expand Down Expand Up @@ -359,6 +406,12 @@ jobs:
name: android-natives
path: build/native

- name: Download natives for iOS
uses: actions/download-artifact@master
with:
name: ios-natives
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework

- name: Rebuild the maven artifacts and deploy them to the Sonatype repository
run: |
if [ "${{ secrets.OSSRH_PASSWORD }}" = "" ];
Expand Down Expand Up @@ -416,6 +469,12 @@ jobs:
name: android-natives
path: build/native

- name: Download natives for iOS
uses: actions/download-artifact@master
with:
name: ios-natives
path: jme3-ios-native/template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework

- name: Rebuild the maven artifacts and deploy them to Sonatype OSSRH
run: |
if [ "${{ secrets.OSSRH_PASSWORD }}" = "" ];
Expand Down
35 changes: 35 additions & 0 deletions jme3-ios-native/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import org.apache.tools.ant.taskdefs.condition.Os

task deleteXcframework(type: Delete) {
delete 'template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework'
}

task buildNativeLibIos(type: Exec) {
executable "xcodebuild"
args 'archive', '-project', 'jme3-ios-native.xcodeproj', '-scheme', 'jme3-ios-native', '-configuration', 'release', '-destination', 'generic/platform=iOS', '-archivePath', 'build/archives/jme3-ios-native_iOS', 'SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'
}

task buildNativeLibSimulator(type: Exec) {
executable "xcodebuild"
args 'archive', '-project', 'jme3-ios-native.xcodeproj', '-scheme', 'jme3-ios-native', '-configuration', 'release', '-destination', 'generic/platform=iOS Simulator', '-archivePath', 'build/archives/jme3-ios-native_iOS-Simulator', 'SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'
}

task buildNativeLib(type: Exec) {
dependsOn 'deleteXcframework'
dependsOn 'buildNativeLibIos'
dependsOn 'buildNativeLibSimulator'
executable "xcodebuild"
args '-create-xcframework', '-framework', 'build/archives/jme3-ios-native_iOS.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework', '-framework', 'build/archives/jme3-ios-native_iOS-Simulator.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework', '-output', 'template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework'
}

// buildNativeProjects is a string set to "true"
if (Os.isFamily(Os.FAMILY_MAC) && buildNativeProjects == "true") {
// build native libs and update stored pre-compiled libs to commit
compileJava.dependsOn { buildNativeLib }
} else {
// TODO: (like android natives?) use pre-compiled native libs (not building new ones)
// compileJava.dependsOn { copyPreCompiledLibs }
println "Native build disable or not running on OSX"
}

jar.into("") { from "template" }
11 changes: 11 additions & 0 deletions jme3-ios-native/export.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
rm -rf intermediate-builds release template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework
mkdir intermediate-builds release
xcodebuild archive -project jme3-ios-native.xcodeproj -scheme jme3-ios-native -destination generic/platform=iOS -archivePath intermediate-builds/jme3-ios-native_iOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
xcodebuild archive -project jme3-ios-native.xcodeproj -scheme jme3-ios-native -destination generic/platform="iOS Simulator" -archivePath intermediate-builds/jme3-ios-native_iOS-Simulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES

xcodebuild -create-xcframework -framework intermediate-builds/jme3-ios-native_iOS.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework -framework intermediate-builds/jme3-ios-native_iOS-Simulator.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework -output template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework

cd template
zip -r ../release/jme3-ios-native.jar META-INF
cd ..

Loading