From ec98c5db526b6fa1274c79cc9504ed78fb155c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey=20Vilas?= Date: Tue, 15 Mar 2022 14:41:05 +0100 Subject: [PATCH] Centralize NDK and CMAKE versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey Vilas --- .github/workflows/qa.yml | 4 +++- app/build.gradle | 9 ++++++++- ndk.env | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 ndk.env diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index e3d708e2d1..004a1f8158 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -20,7 +20,9 @@ jobs: distribution: "temurin" java-version: 11 - name: Install NDK and cmake - run: /usr/local/lib/android/sdk/tools/bin/sdkmanager 'ndk;21.4.7075529' 'cmake;3.18.1' + run: | + source ndk.env + /usr/local/lib/android/sdk/tools/bin/sdkmanager "ndk;${NDK_VERSION}" "cmake;${CMAKE_VERSION}" - name: Build QA if: ${{ steps.check-secrets.outputs.ok == 'true' }} env: diff --git a/app/build.gradle b/app/build.gradle index 1290653aaa..421ac7849b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,11 +69,18 @@ def versionMinor = 20 def versionPatch = 0 def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable + +def ndkEnv = new HashMap() +file("$project.rootDir/ndk.env").readLines().each() { + def (key, value) = it.tokenize('=') + ndkEnv.put(key, value) +} + android { compileSdkVersion 31 // install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed - ndkVersion "21.4.7075529" + ndkVersion "${ndkEnv.get("NDK_VERSION")}" defaultConfig { minSdkVersion 23 diff --git a/ndk.env b/ndk.env new file mode 100644 index 0000000000..540d18b717 --- /dev/null +++ b/ndk.env @@ -0,0 +1,2 @@ +NDK_VERSION=21.4.7075529 +CMAKE_VERSION=3.18.1