Skip to content

Commit ec98c5d

Browse files
committed
Centralize NDK and CMAKE versions
Signed-off-by: Álvaro Brey Vilas <[email protected]>
1 parent 3b5d9dd commit ec98c5d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/qa.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
distribution: "temurin"
2121
java-version: 11
2222
- name: Install NDK and cmake
23-
run: /usr/local/lib/android/sdk/tools/bin/sdkmanager 'ndk;21.4.7075529' 'cmake;3.18.1'
23+
run: |
24+
source ndk.env
25+
/usr/local/lib/android/sdk/tools/bin/sdkmanager "ndk;${NDK_VERSION}" "cmake;${CMAKE_VERSION}"
2426
- name: Build QA
2527
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
2628
env:

app/build.gradle

+8-1
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,18 @@ def versionMinor = 20
6969
def versionPatch = 0
7070
def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
7171

72+
73+
def ndkEnv = new HashMap<String, String>()
74+
file("$project.rootDir/ndk.env").readLines().each() {
75+
def (key, value) = it.tokenize('=')
76+
ndkEnv.put(key, value)
77+
}
78+
7279
android {
7380

7481
compileSdkVersion 31
7582
// install this NDK version and Cmake to produce smaller APKs. Build will still work if not installed
76-
ndkVersion "21.4.7075529"
83+
ndkVersion "${ndkEnv.get("NDK_VERSION")}"
7784

7885
defaultConfig {
7986
minSdkVersion 23

ndk.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NDK_VERSION=21.4.7075529
2+
CMAKE_VERSION=3.18.1

0 commit comments

Comments
 (0)