2 Commits
Author SHA1 Message Date
宋文武 42caa232fa ci: Restore Android workflow
This reverts commit bd497d9554.
2026-10-15 07:55:18 -04:00
宋文武 26e3205b8a Update the android version for SDL3-3.4.18
Also change minSdkVersion to 28 and enable WRITE_EXTERNAL_STORAGE
permission in AndroidManifest.xml, so the build works for Android 9.
2026-10-15 07:55:18 -04:00
7 changed files with 84 additions and 18 deletions

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
name: CI (Android)
# Only trigger workflow when Android-specific code could have changed.
# This includes C/C++ files that have __ANDROID__ ifdefs.
# If adding new ifdefs, make sure to update these lists.
on:
push:
paths:
- "desktop_version/CMakeLists.txt"
- "desktop_version/src/ButtonGlyphs.cpp"
- "desktop_version/src/FileSystemUtils.cpp"
- "desktop_version/src/Screen.cpp"
- "desktop_version/src/Vlogging.c"
- "desktop_version/VVVVVV-android/gradlew"
- "desktop_version/VVVVVV-android/gradlew.bat"
- "desktop_version/VVVVVV-android/**/CMakeLists.txt"
- "desktop_version/VVVVVV-android/**.java"
- "desktop_version/VVVVVV-android/**.xml"
- "desktop_version/VVVVVV-android/**.pro"
- "desktop_version/VVVVVV-android/**.mk"
- "desktop_version/VVVVVV-android/**.gradle"
- "desktop_version/VVVVVV-android/**.jar"
- "desktop_version/VVVVVV-android/**.properties"
- ".github/workflows/android.yml"
pull_request:
paths:
- "desktop_version/CMakeLists.txt"
- "desktop_version/src/ButtonGlyphs.cpp"
- "desktop_version/src/FileSystemUtils.cpp"
- "desktop_version/src/Screen.cpp"
- "desktop_version/src/Vlogging.c"
- "desktop_version/VVVVVV-android/gradlew"
- "desktop_version/VVVVVV-android/gradlew.bat"
- "desktop_version/VVVVVV-android/**/CMakeLists.txt"
- "desktop_version/VVVVVV-android/**.java"
- "desktop_version/VVVVVV-android/**.xml"
- "desktop_version/VVVVVV-android/**.pro"
- "desktop_version/VVVVVV-android/**.mk"
- "desktop_version/VVVVVV-android/**.gradle"
- "desktop_version/VVVVVV-android/**.jar"
- "desktop_version/VVVVVV-android/**.properties"
- ".github/workflows/android.yml"
env:
SRC_DIR_PATH: VVVVVV/desktop_version/VVVVVV-android
SDL_VERSION: 3.4.18
jobs:
build:
name: Build (Android)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
path: 'VVVVVV'
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Get SDL3-${SDL_VERSION}.aar
run: |
cd ${SRC_DIR_PATH}/app/libs
wget https://github.com/libsdl-org/SDL/releases/download/release-${SDL_VERSION}/SDL3-devel-${SDL_VERSION}-android.zip
unzip SDL3-devel-${SDL_VERSION}-android.zip SDL3-${SDL_VERSION}.aar
- name: Build
run: |
cd ${SRC_DIR_PATH}
./gradlew build
+3 -12
View File
@@ -9,21 +9,12 @@ general).
How to Build How to Build
------------ ------------
The recommended way is to install Android Studio and Maven. These instructions are for The recommended way is to install Android Studio. These instructions are for
SDL 2.30.8; adapt your SDL version accordingly. SDL 3.4.18; adapt your SDL version accordingly.
1. Place a copy of `data.zip` in `desktop_version/VVVVVV-android/app/src/main/assets/`. 1. Place a copy of `data.zip` in `desktop_version/VVVVVV-android/app/src/main/assets/`.
(If the `assets/` folder doesn't exist, then create it.) (If the `assets/` folder doesn't exist, then create it.)
2. Obtain the SDL 2.30.8 Maven package. As of writing, SDL currently does not publish 2. Place a copy of `SDL3-3.4.18.aar` in `desktop_version/VVVVVV-android/app/libs/`. It can be download from https://github.com/libsdl-org/SDL/releases/download/release-3.4.18/SDL3-devel-3.4.18-android.zip
Maven packages, so here is one way to obtain them (other methods are possible):
1. Download the SDL 2.30.8 source code.
2. Run the `build-scripts/android-prefab.sh` script in the SDL repository.
3. After building, run `mvn install:install-file
-Dfile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.aar
-DpomFile=build-android-prefab/prefab-2.30.8/SDL2-2.30.8.pom` to install it to
Maven Local.
3. Open the `desktop_version/VVVVVV-android/` folder in Android Studio. 3. Open the `desktop_version/VVVVVV-android/` folder in Android Studio.
4. Click 'Build'. 4. Click 'Build'.
@@ -12,7 +12,7 @@ android {
} }
compileSdkVersion 34 compileSdkVersion 34
defaultConfig { defaultConfig {
minSdkVersion 29 minSdkVersion 28
targetSdkVersion 34 targetSdkVersion 34
versionCode 20005000 versionCode 20005000
versionName "2.5" versionName "2.5"
@@ -110,5 +110,5 @@ dependencies {
implementation 'org.jetbrains:annotations:15.0' implementation 'org.jetbrains:annotations:15.0'
implementation 'androidx.core:core:1.10.1' implementation 'androidx.core:core:1.10.1'
implementation 'androidx.exifinterface:exifinterface:1.3.6' implementation 'androidx.exifinterface:exifinterface:1.3.6'
implementation 'org.libsdl.android:SDL2:2.30.8' implementation files('libs/SDL3-3.4.18.aar')
} }
Whitespace-only changes.
@@ -37,8 +37,8 @@
android:name="android.hardware.microphone" android:name="android.hardware.microphone"
android:required="false" /> --> android:required="false" /> -->
<!-- Allow downloading to the external storage on Android 5.1 and older --> <!-- Allow downloading to the external storage on Android 9 and older -->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="22" /> --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<!-- Allow access to Bluetooth devices --> <!-- Allow access to Bluetooth devices -->
<!-- Currently this is just for Steam Controller support and requires setting SDL_HINT_JOYSTICK_HIDAPI_STEAM --> <!-- Currently this is just for Steam Controller support and requires setting SDL_HINT_JOYSTICK_HIDAPI_STEAM -->
@@ -6,7 +6,7 @@ public class VVVVVV extends SDLActivity {
@Override @Override
protected String[] getLibraries() { protected String[] getLibraries() {
return new String[] { return new String[] {
"SDL2", "SDL3",
"VVVVVV" "VVVVVV"
}; };
} }
+1 -1
View File
@@ -2,7 +2,7 @@
#ifdef SDL_PLATFORM_EMSCRIPTEN #ifdef SDL_PLATFORM_EMSCRIPTEN
#include <emscripten.h> #include <emscripten.h>
#include <emscripten/html5.h> #include <emscripten/html5.h>
#elif defined(SDL_PLATFORM_WINDOWS) #elif defined(SDL_PLATFORM_WINDOWS) || defined(SDL_PLATFORM_ANDROID)
#include <SDL3/SDL_main.h> #include <SDL3/SDL_main.h>
#endif #endif