Merge pull request #10724 from t895/auto-version-property

android: Use autoVersion when gradle property is set
This commit is contained in:
bunnei 2023-06-12 13:12:32 -07:00 committed by GitHub
commit 5a2e0d5b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -2,6 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import android.annotation.SuppressLint
import org.jetbrains.kotlin.konan.properties.Properties
plugins {
id("com.android.application")
@ -57,9 +58,22 @@ android {
applicationId = "org.yuzu.yuzu_emu"
minSdk = 30
targetSdk = 33
versionCode = 1
versionName = getGitVersion()
// If you want to use autoVersion for the versionCode, create a property in local.properties
// named "autoVersioned" and set it to "true"
val properties = Properties()
val versionProperty = try {
properties.load(project.rootProject.file("local.properties").inputStream())
properties.getProperty("autoVersioned") ?: ""
} catch (e: Exception) { "" }
versionCode = if (versionProperty == "true") {
autoVersion
} else {
1
}
ndk {
@SuppressLint("ChromeOsAbiSupport")
abiFilters += listOf("arm64-v8a")