From 8f340530e0701a96d36d8b357e7df3c4a03ff237 Mon Sep 17 00:00:00 2001 From: scarf Date: Thu, 28 Sep 2023 00:54:05 +0900 Subject: [PATCH] build: bump android ndk (#3289) * build: bump android ndk see: https://github.com/CleverRaven/Cataclysm-DDA/pull/64305 Co-authored-by: Brett Dong * ci: bump jdk version to 11 --------- Co-authored-by: Brett Dong --- .github/workflows/android.yml | 4 ++-- .github/workflows/manual-release.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- android/.gitignore | 1 + android/app/build.gradle | 8 ++++++++ android/app/jni/Application.mk | 2 +- android/app/src/main/AndroidManifest.xml | 1 - android/build.gradle | 6 +++--- android/gradle.properties | 8 ++++++-- android/gradle/wrapper/gradle-wrapper.properties | 2 +- 10 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 95761e1f264d..29062beb7757 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -35,10 +35,10 @@ jobs: with: fetch-depth: 1 - - name: Set up JDK 8 (android) + - name: Set up JDK 11 (android) uses: actions/setup-java@v3 with: - java-version: "8" + java-version: "11" distribution: "adopt" - name: Setup build and dependencies diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml index e957276da83b..221858f24535 100644 --- a/.github/workflows/manual-release.yml +++ b/.github/workflows/manual-release.yml @@ -249,11 +249,11 @@ jobs: run: | make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LANGUAGES=all USE_HOME_DIR=1 OSX_MIN=11 PCH=0 dmgdist COMPILER=clang++ mv CataclysmBN-${{ inputs.version }}.dmg cbn-${{ matrix.artifact }}-${{ inputs.version }}.dmg - - name: Set up JDK 8 (android) + - name: Set up JDK 11 (android) if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none' uses: actions/setup-java@v3 with: - java-version: "8" + java-version: "11" distribution: "adopt" - name: Setup Build and Dependencies (android) if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9a763277281..22617f98f62b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -249,11 +249,11 @@ jobs: run: | make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} LUA=1 RELEASE=1 LANGUAGES=all USE_HOME_DIR=1 OSX_MIN=11 PCH=0 dmgdist COMPILER=clang++ mv CataclysmBN-unstable.dmg cbn-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.dmg - - name: Set up JDK 8 (android) + - name: Set up JDK 11 (android) if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none' uses: actions/setup-java@v3 with: - java-version: "8" + java-version: "11" distribution: "adopt" - name: Setup Build and Dependencies (android) if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none' diff --git a/android/.gitignore b/android/.gitignore index 79469f4e55cb..a36f14bf599f 100644 --- a/android/.gitignore +++ b/android/.gitignore @@ -12,6 +12,7 @@ /app/jni/SDL2_mixer /app/jni/SDL2_ttf /app/jni/libintl-lite +/app/jni/libhidapi /app/jni/lua /app/jni/mpg-123 /app/build diff --git a/android/app/build.gradle b/android/app/build.gradle index bcf3ea1dd516..db623bb276c3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -99,6 +99,11 @@ if (localProperties.getProperty('override_ndkBuildAppPlatform') != null) { override_ndkBuildAppPlatform = localProperties.getProperty("override_ndkBuildAppPlatform") } +def override_ndkVersion = getProperty("override_ndkVersion") +if (localProperties.getProperty('override_ndkVersion') != null) { + override_ndkVersion = localProperties.getProperty('override_ndkVersion') +} + println("Using [ njobs]: $njobs") println("Using [ localize]: $localize") println("Using [ deps]: $deps") @@ -108,6 +113,7 @@ println("Using [ compileSdkVersion]: $override_compileSdkVersion") println("Using [ minSdkVersion]: $override_minSdkVersion") println("Using [ targetSdkVersion]: $override_targetSdkVersion") println("Using [ndkBuildAppPlatform]: $override_ndkBuildAppPlatform") +println("Using [ ndkVersion]: $override_ndkVersion") println("Using [ abi_arm_32]: $abi_arm_32") println("Using [ abi_arm_64]: $abi_arm_64") println("Using [ abi_x86_32]: $abi_x86_32") @@ -164,7 +170,9 @@ unzipDeps.dependsOn makeLocalization preBuild.dependsOn unzipDeps android { + namespace "com.cleverraven.cataclysmdda" compileSdkVersion override_compileSdkVersion + ndkVersion override_ndkVersion if (override_version.isEmpty()) { println("Generating version number to $version_header_path") diff --git a/android/app/jni/Application.mk b/android/app/jni/Application.mk index 4001bc2c51d7..b4e538196d0f 100644 --- a/android/app/jni/Application.mk +++ b/android/app/jni/Application.mk @@ -4,7 +4,7 @@ APP_STL := c++_shared APP_CPPFLAGS += -std=c++17 ifneq ($(OS),Windows_NT) - APP_LDFLAGS += -fuse-ld=gold + APP_LDFLAGS += -fuse-ld=lld endif # Do not specify APP_OPTIM here, it is done through ndk-build NDK_DEBUG=0/1 setting instead diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index e58eb2a577bb..13723c5d37a6 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -3,7 +3,6 @@ com.gamemaker.game --> diff --git a/android/build.gradle b/android/build.gradle index c95742af2fe9..e6b00681983d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,11 +2,11 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:7.4.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -15,7 +15,7 @@ buildscript { allprojects { repositories { - jcenter() + mavenCentral() google() } } diff --git a/android/gradle.properties b/android/gradle.properties index ae6e7a3fc3c8..190603bf645d 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -58,7 +58,7 @@ override_compileSdkVersion=29 # This property controls which minSdkVersion should be used # You can override this from the command line by passing "-Poverride_minSdkVersion=#" -override_minSdkVersion=14 +override_minSdkVersion=21 # This property controls which targetSdkVersion should be used # You can override this from the command line by passing "-Poverride_targetSdkVersion=#" @@ -66,4 +66,8 @@ override_targetSdkVersion=29 # This property controls which ndkBuildAppPlatform should be used # You can override this from the command line by passing "-Poverride_ndkBuildAppPlatform=#" -override_ndkBuildAppPlatform=android-16 +override_ndkBuildAppPlatform=android-21 + +# This property controls which ndkVersion should be used +# You can override this from the command line by passing "-Poverride_ndkVersion=#" +override_ndkVersion=25.2.9519653 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index d4f1ff57f1dd..18f365e50cbf 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip