Skip to content

Commit b28bedf

Browse files
committed
chore: specify ndk version in a separate file so it can be synced between multiple native modules
1 parent 50bf540 commit b28bedf

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

sysbridge/NDK_VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
27.2.12479018

sysbridge/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ android {
1313
namespace = "io.github.sds100.keymapper.sysbridge"
1414
compileSdk = libs.versions.compile.sdk.get().toInt()
1515

16+
// Read NDK version from NDK_VERSION file, with fallback to gradle.properties
17+
// The NDK version is stored in a file so the same value can be used across multiple modules.
18+
val ndkVersionFile = project.file("NDK_VERSION")
19+
val ndkVersionFromFile = if (ndkVersionFile.exists()) {
20+
ndkVersionFile.readText().trim()
21+
} else {
22+
null
23+
}
24+
ndkVersion = ndkVersionFromFile!!
25+
1626
defaultConfig {
1727
// Must be API 29 so that the binder-ndk library can be found.
1828
minSdk = 29

0 commit comments

Comments
 (0)