0.1.0-0-pre.8

This commit is contained in:
2026-09-16 09:39:53 +02:00
parent 431665992c
commit 00808ea5a6
21 changed files with 410 additions and 30 deletions

View File

@@ -1,5 +1,5 @@
<!-- file: Android/README.md -->
<!-- version: 4 -->
<!-- version: 5 -->
# Android
@@ -20,7 +20,7 @@ Chaque module `game-*` est une application Android indépendante ; il dépend du
## Toolchain de référence
Pour la baseline `0.1.0-0-pre.6` :
Pour la baseline `0.1.0-0-pre.8` :
- Android Gradle Plugin `9.4.0` ;
- Gradle `9.6.0` attendu par AGP 9.4 ;
@@ -70,3 +70,9 @@ python3 ../scripts/build_android_rust.py snake
```
Le script extrait temporairement `libSDL3.so` de l'AAR uniquement pour fournir le chemin de linkage à `rustc`; l'AAR reste responsable du packaging SDL3 dans l'APK.
## Bridge JNI et tactile
À partir de `0.1.0-0-pre.8`, `SaseGameActivity` vérifie au démarrage la version du bridge Java/JNI chargé depuis la bibliothèque Rust.
Les touch events standards restent traités via SDL3 et ne transitent pas par JNI.

View File

@@ -1,19 +1,37 @@
// file: Android/common/src/main/java/com/sasedev/games/common/NativeBridge.java
// version: 1
// version: 2
package com.sasedev.games.common;
/** Stable Java side of the future Java/JNI platform bridge. */
/** Stable Java/JNI platform bridge contract shared by Android game applications. */
public final class NativeBridge {
private static final int CONTRACT_VERSION = 1;
private NativeBridge() {
}
/**
* Returns the bridge contract version.
* Returns the Java-side bridge contract version.
*
* @return bridge contract version
*/
public static int contractVersion() {
return 1;
return CONTRACT_VERSION;
}
/**
* Returns the Rust-side bridge contract version.
*
* @return native bridge contract version
*/
public static native int nativeContractVersion();
/** Verifies that the loaded native bridge matches the Java contract. */
public static void requireCompatibleContract() {
final int nativeVersion = nativeContractVersion();
if (nativeVersion != CONTRACT_VERSION) {
throw new IllegalStateException(
"Native bridge contract mismatch: java=" + CONTRACT_VERSION + ", native=" + nativeVersion);
}
}
}

View File

@@ -1,8 +1,10 @@
// file: Android/common/src/main/java/com/sasedev/games/common/SaseGameActivity.java
// version: 3
// version: 4
package com.sasedev.games.common;
import android.os.Bundle;
/**
* Common Android activity boundary for games.sasedev applications.
*
@@ -10,6 +12,13 @@ package com.sasedev.games.common;
*/
public abstract class SaseGameActivity extends org.libsdl.app.SDLActivity {
/** {@inheritDoc} */
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NativeBridge.requireCompatibleContract();
}
/** {@inheritDoc} */
@Override
protected final String[] getLibraries() {

View File

@@ -1,5 +1,5 @@
// file: Android/game-reflex-poc/build.gradle
// version: 5
// version: 6
plugins {
id 'com.android.application'
@@ -16,7 +16,7 @@ android {
minSdk 21
targetSdk 36
versionCode 1
versionName '0.1.0-0-pre.7.fix.1'
versionName '0.1.0-0-pre.8'
}
compileOptions {

View File

@@ -1,5 +1,5 @@
// file: Android/game-snake-poc/build.gradle
// version: 5
// version: 6
plugins {
id 'com.android.application'
@@ -16,7 +16,7 @@ android {
minSdk 21
targetSdk 36
versionCode 1
versionName '0.1.0-0-pre.7.fix.1'
versionName '0.1.0-0-pre.8'
}
compileOptions {