Compare commits

...

4 Commits

Author SHA1 Message Date
Miku AuahDark 07088eee88 Bump Minimum SDK to API 18 (KitKat)
Support for Jelly Bean has been gone the moment we update NDK toolchain version. See #279 for the rational on this change.
2024-10-12 09:51:23 +08:00
Miku AuahDark 3d1503f917 Respect user orientation lock setting for resizable window.
Cherry-picked from libsdl-org/SDL@3373667.
2024-06-18 11:03:15 +08:00
Miku AuahDark 65c4223d0a Update actions/checkout and actions/upload-artifact to v4. 2024-02-16 10:54:19 +08:00
Miku AuahDark 1975903d2e Separate debug and release APK build to reduce CI build times. 2024-02-16 10:54:14 +08:00
4 changed files with 28 additions and 17 deletions
+22 -11
View File
@@ -5,46 +5,57 @@ on: [push, pull_request]
jobs:
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: 17
cache: gradle
- name: Build
run: bash ./gradlew assembleNormalRecord assembleEmbedRelease bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
- name: Build Normal Flavor
run: bash ./gradlew assembleNormalRecord${{ matrix.build_type }}
- name: Build Release-specific Binaries
if: ${{ matrix.build_type == 'Release' }}
run: bash ./gradlew assembleEmbedRelease bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
- name: Artifact (Normal debug APK)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Debug' }}
uses: actions/upload-artifact@v4
with:
name: love-android-debug.apk
path: app/build/outputs/apk/normalRecord/debug/app-normal-record-debug.apk
- name: Artifact (Normal unsigned APK)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android.apk
path: app/build/outputs/apk/normalRecord/release/app-normal-record-release-unsigned.apk
- name: Artifact (Normal AAB w/o recording)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-ps.aab
path: app/build/outputs/bundle/normalNoRecordRelease/app-normal-noRecord-release.aab
- name: Artifact (Embed AAB)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-embed-record.aab
path: app/build/outputs/bundle/embedRecordRelease/app-embed-record-release.aab
- name: Artifact (Embed AAB w/o recording)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-embed.aab
path: app/build/outputs/bundle/embedNoRecordRelease/app-embed-noRecord-release.aab
- name: Artifact (Debug symbols)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: love-android-unstripped-debugsyms
name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
path: love/build/intermediates/library_jni
+1 -1
View File
@@ -10,7 +10,7 @@ android {
applicationId project.properties["app.application_id"]
versionCode project.properties["app.version_code"].toInteger()
versionName project.properties["app.version_name"]
minSdk 16
minSdk 18
compileSdk 34
targetSdk 34
+1 -1
View File
@@ -10,7 +10,7 @@ android {
ndkVersion '25.2.9519653'
defaultConfig {
minSdk 16
minSdk 18
compileSdk 34
targetSdk 34
externalNativeBuild {
@@ -1023,8 +1023,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* No valid hint, nothing is explicitly allowed */
if (!is_portrait_allowed && !is_landscape_allowed) {
if (resizable) {
/* All orientations are allowed */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* All orientations are allowed, respecting user orientation lock setting */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Fixed window and nothing specified. Get orientation from w/h of created window */
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
@@ -1033,8 +1033,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* At least one orientation is allowed */
if (resizable) {
if (is_portrait_allowed && is_landscape_allowed) {
/* hint allows both landscape and portrait, promote to full sensor */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* hint allows both landscape and portrait, promote to full user */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Use the only one allowed "orientation" */
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);