Skip to content

Commit

Permalink
Merge pull request OpenBrickProtocolFoundation#112 from mgerhold/fix-…
Browse files Browse the repository at this point in the history
…cpplint

Fix CPPLint and android build bug
  • Loading branch information
Totto16 authored Jan 2, 2024
2 parents 0a09252 + 7605a71 commit 2b0a7d5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
- name: Build APK
run: |
cd platforms/android/
./gradlew bundleDebug --no-daemon
./gradlew assembleDebug --no-daemon
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: oopetris.aab
path: platforms/android/app/build/outputs/bundle/debug/app-debug.aab
name: oopetris.all-apks
path: platforms/android/app/build/outputs/apk/debug/app-*-debug.apk
25 changes: 19 additions & 6 deletions platforms/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,22 @@ if (buildAsApplication) {
}

android {
compileSdkVersion 34
compileSdk 34
ndkVersion "26.1.10909125"
defaultConfig {
if (buildAsApplication) {
applicationId "com.github.oopetris"
}
minSdkVersion 21
targetSdkVersion 34
versionCode 2
versionName "1.0.2"
versionCode 3
versionName "1.0.3"
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-34"
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildTypes {
release {
Expand Down Expand Up @@ -63,6 +60,22 @@ android {
}
}
}
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs per ABI.
enable true
// By default all ABIs are included, so use reset() and include to specify that you only
// want APKs for the ones with a ndk variant (4, android did in the past support more: https://developer.android.com/ndk/guides/abis.html#sa)
// Resets the list of ABIs for Gradle to create APKs for to none.
reset()
// Specifies a list of ABIs for Gradle to create APKs for.
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
// Specifies that you don't want to also generate a universal APK that includes all ABIs.
universalApk false
}
}

}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions platforms/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Aug 19 23:33:07 CEST 2023
#Tue Jan 02 02:01:38 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
9 changes: 8 additions & 1 deletion platforms/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,17 @@ for INDEX in "${!ARCH_KEYS[@]}"; do

cd "$LAST_DIR"

MESON_CPU_FAMILY=$ARCH

## this is a flaw in the abis.json, everything is labelled with aarch64 and not arm64, but the "arch" json value is wrong, and meson (https://mesonbuild.com/Reference-tables.html#cpu-families) only knows aarch64!
if [[ $MESON_CPU_FAMILY = "arm64" ]]; then
MESON_CPU_FAMILY="aarch64"
fi

cat <<EOF >"./platforms/crossbuild-android-$ARM_TARGET_ARCH.ini"
[host_machine]
system = 'android'
cpu_family = '$ARCH'
cpu_family = '$MESON_CPU_FAMILY'
cpu = '$ARM_VERSION'
endian = 'little'
Expand Down

0 comments on commit 2b0a7d5

Please sign in to comment.