diff options
| author | 2023-06-12 13:12:32 -0700 | |
|---|---|---|
| committer | 2023-06-12 13:12:32 -0700 | |
| commit | 5a2e0d5b76897263ae28a50544e9bae2f28a8e42 (patch) | |
| tree | ec294522c79111748605e076ee981e9edf190ad2 /src | |
| parent | Merge pull request #10699 from liamwhite/conditional-barrier (diff) | |
| parent | android: Use autoVersion when gradle property is set (diff) | |
| download | yuzu-5a2e0d5b76897263ae28a50544e9bae2f28a8e42.tar.gz yuzu-5a2e0d5b76897263ae28a50544e9bae2f28a8e42.tar.xz yuzu-5a2e0d5b76897263ae28a50544e9bae2f28a8e42.zip | |
Merge pull request #10724 from t895/auto-version-property
android: Use autoVersion when gradle property is set
Diffstat (limited to 'src')
| -rw-r--r-- | src/android/app/build.gradle.kts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index d4698ae1c..fe613d339 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | 2 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | 3 | ||
| 4 | import android.annotation.SuppressLint | 4 | import android.annotation.SuppressLint |
| 5 | import org.jetbrains.kotlin.konan.properties.Properties | ||
| 5 | 6 | ||
| 6 | plugins { | 7 | plugins { |
| 7 | id("com.android.application") | 8 | id("com.android.application") |
| @@ -57,9 +58,22 @@ android { | |||
| 57 | applicationId = "org.yuzu.yuzu_emu" | 58 | applicationId = "org.yuzu.yuzu_emu" |
| 58 | minSdk = 30 | 59 | minSdk = 30 |
| 59 | targetSdk = 33 | 60 | targetSdk = 33 |
| 60 | versionCode = 1 | ||
| 61 | versionName = getGitVersion() | 61 | versionName = getGitVersion() |
| 62 | 62 | ||
| 63 | // If you want to use autoVersion for the versionCode, create a property in local.properties | ||
| 64 | // named "autoVersioned" and set it to "true" | ||
| 65 | val properties = Properties() | ||
| 66 | val versionProperty = try { | ||
| 67 | properties.load(project.rootProject.file("local.properties").inputStream()) | ||
| 68 | properties.getProperty("autoVersioned") ?: "" | ||
| 69 | } catch (e: Exception) { "" } | ||
| 70 | |||
| 71 | versionCode = if (versionProperty == "true") { | ||
| 72 | autoVersion | ||
| 73 | } else { | ||
| 74 | 1 | ||
| 75 | } | ||
| 76 | |||
| 63 | ndk { | 77 | ndk { |
| 64 | @SuppressLint("ChromeOsAbiSupport") | 78 | @SuppressLint("ChromeOsAbiSupport") |
| 65 | abiFilters += listOf("arm64-v8a") | 79 | abiFilters += listOf("arm64-v8a") |