0.1.0-0-pre.6

This commit is contained in:
2026-09-16 08:49:45 +02:00
parent 380a24681d
commit 21e45d333d
22 changed files with 452 additions and 34 deletions

7
Android/.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
# file: Android/.gitignore
# version: 1
.gradle/
**/build/
local.properties
libs/*.aar

View File

@@ -1,13 +1,11 @@
<!-- file: Android/README.md -->
<!-- version: 1 -->
<!-- version: 2 -->
# Android
Squelette du frontend Android multi-module.
Le frontend Android est un projet Gradle multi-module séparé du workspace Cargo.
La baseline définit les frontières Java et les modules, mais ne fige pas encore Android Gradle Plugin, SDK/NDK, SDL3 AAR ni le pipeline Cargo/NDK. Ces éléments seront ajoutés ensemble dans la prerelease Android exécutable afin d'éviter une fausse configuration partiellement fonctionnelle.
Structure cible :
## Modules
```text
Android/
@@ -16,4 +14,44 @@ Android/
└── game-snake-poc/
```
`common` deviendra une Android Library. Chaque module jeu deviendra une application indépendante et réutilisera directement les crates Rust du workspace racine sans les recopier.
`common` est une Android Library Java qui fournit la frontière commune et dépend de l'AAR officiel SDL3.
Chaque module `game-*` est une application Android indépendante et dépend du module `common`.
## Toolchain de référence
Pour la baseline `0.1.0-0-pre.6` :
- Android Gradle Plugin `9.4.0` ;
- Gradle `9.6.0` attendu par AGP 9.4 ;
- JDK `17` ;
- `compileSdk 36` ;
- `targetSdk 36` ;
- `minSdk 21` ;
- SDL3 Android AAR `3.4.16`.
Le NDK n'est pas encore utilisé directement dans ce delta. Le prochain jalon introduira la compilation Rust Android `cdylib` et figera la configuration NDK réellement nécessaire.
## SDL3 AAR
L'archive n'est pas vendorizée dans le dépôt.
Placer :
```text
SDL3-3.4.16.aar
```
dans :
```text
Android/libs/
```
Le module `common` consomme cet artefact et `SaseGameActivity` étend désormais `org.libsdl.app.SDLActivity`.
## Limite volontaire de ce jalon
Les APK peuvent être compilés côté Java/SDL3 une fois l'AAR disponible, mais ne disposent pas encore du `cdylib` Rust contenant le point d'entrée de jeu.
Le lancement fonctionnel sur appareil/émulateur appartient donc au delta suivant.

View File

@@ -1,4 +1,7 @@
// file: Android/build.gradle
// version: 1
// version: 2
// Android Gradle Plugin and repositories are intentionally introduced in the dedicated executable Android prerelease.
plugins {
id 'com.android.application' version '9.4.0' apply false
id 'com.android.library' version '9.4.0' apply false
}

View File

@@ -1,4 +1,26 @@
// file: Android/common/build.gradle
// version: 1
// version: 2
// This module will become the reusable Android library containing SDLActivity integration and common platform services.
plugins {
id 'com.android.library'
}
def sdl3AarName = providers.gradleProperty("sdl3AarName").get()
android {
namespace 'com.sasedev.games.common'
compileSdk 36
defaultConfig {
minSdk 21
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
api files("../libs/${sdl3AarName}")
}

View File

@@ -0,0 +1,3 @@
<!-- file: Android/common/src/main/AndroidManifest.xml -->
<!-- version: 1 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

View File

@@ -1,14 +1,14 @@
// file: Android/common/src/main/java/com/sasedev/games/common/SaseGameActivity.java
// version: 1
// version: 2
package com.sasedev.games.common;
/**
* Common Android activity boundary for games.sasedev applications.
*
* <p>The executable Android delta will make this class extend SDLActivity once the SDL3 AAR is introduced.</p>
* <p>The SDL3 Android AAR supplies the common {@code SDLActivity} host. Game-specific activities extend this class.</p>
*/
public abstract class SaseGameActivity {
public abstract class SaseGameActivity extends org.libsdl.app.SDLActivity {
/**
* Returns the stable identifier of the game hosted by the activity.
*

View File

@@ -1,4 +1,28 @@
// file: Android/game-reflex-poc/build.gradle
// version: 1
// version: 2
// This module will become the Reflex POC Android application.
plugins {
id 'com.android.application'
}
android {
namespace 'com.sasedev.games.reflex'
compileSdk 36
defaultConfig {
applicationId 'com.sasedev.games.reflex'
minSdk 21
targetSdk 36
versionCode 1
versionName '0.1.0-0-pre.6'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation project(':common')
}

View File

@@ -0,0 +1,19 @@
<!-- file: Android/game-reflex-poc/src/main/AndroidManifest.xml -->
<!-- version: 1 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">
<activity
android:name=".ReflexActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -1,4 +1,28 @@
// file: Android/game-snake-poc/build.gradle
// version: 1
// version: 2
// This module will become the Snake POC Android application.
plugins {
id 'com.android.application'
}
android {
namespace 'com.sasedev.games.snake'
compileSdk 36
defaultConfig {
applicationId 'com.sasedev.games.snake'
minSdk 21
targetSdk 36
versionCode 1
versionName '0.1.0-0-pre.6'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
implementation project(':common')
}

View File

@@ -0,0 +1,19 @@
<!-- file: Android/game-snake-poc/src/main/AndroidManifest.xml -->
<!-- version: 1 -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">
<activity
android:name=".SnakeActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,6 @@
# file: Android/gradle.properties
# version: 1
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
sdl3AarName=SDL3-3.4.16.aar

24
Android/libs/README.md Normal file
View File

@@ -0,0 +1,24 @@
<!-- file: Android/libs/README.md -->
<!-- version: 1 -->
# SDL3 Android Archive
Le projet Android consomme l'archive Android officielle SDL3 sous forme de dépendance externe locale.
Version attendue pour cette baseline :
```text
SDL3-3.4.16.aar
```
Le fichier doit être placé ici :
```text
Android/libs/SDL3-3.4.16.aar
```
L'archive AAR n'est pas versionnée dans le dépôt.
La version attendue est déclarée dans `Android/gradle.properties` avec `sdl3AarName`.
SDL recommande l'utilisation de son archive Android pour éviter de recopier les sources C et Java de SDL dans chaque projet Android. L'AAR contient notamment la couche Java SDL et les bibliothèques natives nécessaires au runtime Android.

View File

@@ -1,5 +1,21 @@
// file: Android/settings.gradle
// version: 1
// version: 2
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "games-sasedev-android"