chore(build): prioritize injected version properties (#3043)

This commit is contained in:
James Rich
2025-09-09 20:13:41 -05:00
committed by GitHub
parent 4bed39b6c1
commit 92e448f211

View File

@@ -59,9 +59,13 @@ android {
applicationId = Configs.APPLICATION_ID
minSdk = Configs.MIN_SDK
targetSdk = Configs.TARGET_SDK
// Prioritize ENV, then fallback to git commit count for versionCode
versionCode = (System.getenv("VERSION_CODE") ?: gitVersionProvider.get()).toInt()
versionName = System.getenv("VERSION_NAME") ?: Configs.VERSION_NAME_BASE
// Prioritize injected props, then ENV, then fallback to git commit count
versionCode = (project.findProperty("android.injected.version.code")?.toString()?.toInt()
?: System.getenv("VERSION_CODE")?.toInt()
?: gitVersionProvider.get().toInt())
versionName = (project.findProperty("android.injected.version.name")?.toString()
?: System.getenv("VERSION_NAME")
?: Configs.VERSION_NAME_BASE)
testInstrumentationRunner = "com.geeksville.mesh.TestRunner"
buildConfigField("String", "MIN_FW_VERSION", "\"${Configs.MIN_FW_VERSION}\"")
buildConfigField("String", "ABS_MIN_FW_VERSION", "\"${Configs.ABS_MIN_FW_VERSION}\"")