diff options
Diffstat (limited to 'src/android/app/build.gradle.kts')
| -rw-r--r-- | src/android/app/build.gradle.kts | 73 |
1 files changed, 47 insertions, 26 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index 13bb227ff..bab4f4d0f 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts | |||
| @@ -2,12 +2,17 @@ | |||
| 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 kotlin.collections.setOf | ||
| 6 | import org.jetbrains.kotlin.konan.properties.Properties | ||
| 7 | import org.jlleitschuh.gradle.ktlint.reporter.ReporterType | ||
| 5 | 8 | ||
| 6 | plugins { | 9 | plugins { |
| 7 | id("com.android.application") | 10 | id("com.android.application") |
| 8 | id("org.jetbrains.kotlin.android") | 11 | id("org.jetbrains.kotlin.android") |
| 9 | id("kotlin-parcelize") | 12 | id("kotlin-parcelize") |
| 10 | kotlin("plugin.serialization") version "1.8.21" | 13 | kotlin("plugin.serialization") version "1.8.21" |
| 14 | id("androidx.navigation.safeargs.kotlin") | ||
| 15 | id("org.jlleitschuh.gradle.ktlint") version "11.4.0" | ||
| 11 | } | 16 | } |
| 12 | 17 | ||
| 13 | /** | 18 | /** |
| @@ -42,24 +47,27 @@ android { | |||
| 42 | jniLibs.useLegacyPackaging = true | 47 | jniLibs.useLegacyPackaging = true |
| 43 | } | 48 | } |
| 44 | 49 | ||
| 45 | lint { | ||
| 46 | // This is important as it will run lint but not abort on error | ||
| 47 | // Lint has some overly obnoxious "errors" that should really be warnings | ||
| 48 | abortOnError = false | ||
| 49 | |||
| 50 | //Uncomment disable lines for test builds... | ||
| 51 | //disable 'MissingTranslation'bin | ||
| 52 | //disable 'ExtraTranslation' | ||
| 53 | } | ||
| 54 | |||
| 55 | defaultConfig { | 50 | defaultConfig { |
| 56 | // TODO If this is ever modified, change application_id in strings.xml | 51 | // TODO If this is ever modified, change application_id in strings.xml |
| 57 | applicationId = "org.yuzu.yuzu_emu" | 52 | applicationId = "org.yuzu.yuzu_emu" |
| 58 | minSdk = 30 | 53 | minSdk = 30 |
| 59 | targetSdk = 33 | 54 | targetSdk = 33 |
| 60 | versionCode = 1 | ||
| 61 | versionName = getGitVersion() | 55 | versionName = getGitVersion() |
| 62 | 56 | ||
| 57 | // If you want to use autoVersion for the versionCode, create a property in local.properties | ||
| 58 | // named "autoVersioned" and set it to "true" | ||
| 59 | val properties = Properties() | ||
| 60 | val versionProperty = try { | ||
| 61 | properties.load(project.rootProject.file("local.properties").inputStream()) | ||
| 62 | properties.getProperty("autoVersioned") ?: "" | ||
| 63 | } catch (e: Exception) { "" } | ||
| 64 | |||
| 65 | versionCode = if (versionProperty == "true") { | ||
| 66 | autoVersion | ||
| 67 | } else { | ||
| 68 | 1 | ||
| 69 | } | ||
| 70 | |||
| 63 | ndk { | 71 | ndk { |
| 64 | @SuppressLint("ChromeOsAbiSupport") | 72 | @SuppressLint("ChromeOsAbiSupport") |
| 65 | abiFilters += listOf("arm64-v8a") | 73 | abiFilters += listOf("arm64-v8a") |
| @@ -74,16 +82,7 @@ android { | |||
| 74 | 82 | ||
| 75 | // Signed by release key, allowing for upload to Play Store. | 83 | // Signed by release key, allowing for upload to Play Store. |
| 76 | release { | 84 | release { |
| 77 | signingConfig = signingConfigs.getByName("debug") | 85 | resValue("string", "app_name_suffixed", "yuzu") |
| 78 | isMinifyEnabled = true | ||
| 79 | isDebuggable = false | ||
| 80 | proguardFiles( | ||
| 81 | getDefaultProguardFile("proguard-android.txt"), | ||
| 82 | "proguard-rules.pro" | ||
| 83 | ) | ||
| 84 | } | ||
| 85 | |||
| 86 | register("relWithVersionCode") { | ||
| 87 | signingConfig = signingConfigs.getByName("debug") | 86 | signingConfig = signingConfigs.getByName("debug") |
| 88 | isMinifyEnabled = true | 87 | isMinifyEnabled = true |
| 89 | isDebuggable = false | 88 | isDebuggable = false |
| @@ -96,6 +95,7 @@ android { | |||
| 96 | // builds a release build that doesn't need signing | 95 | // builds a release build that doesn't need signing |
| 97 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. | 96 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. |
| 98 | register("relWithDebInfo") { | 97 | register("relWithDebInfo") { |
| 98 | resValue("string", "app_name_suffixed", "yuzu Debug Release") | ||
| 99 | signingConfig = signingConfigs.getByName("debug") | 99 | signingConfig = signingConfigs.getByName("debug") |
| 100 | isMinifyEnabled = true | 100 | isMinifyEnabled = true |
| 101 | isDebuggable = true | 101 | isDebuggable = true |
| @@ -103,16 +103,19 @@ android { | |||
| 103 | getDefaultProguardFile("proguard-android.txt"), | 103 | getDefaultProguardFile("proguard-android.txt"), |
| 104 | "proguard-rules.pro" | 104 | "proguard-rules.pro" |
| 105 | ) | 105 | ) |
| 106 | versionNameSuffix = "-debug" | 106 | versionNameSuffix = "-relWithDebInfo" |
| 107 | applicationIdSuffix = ".relWithDebInfo" | ||
| 107 | isJniDebuggable = true | 108 | isJniDebuggable = true |
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | // Signed by debug key disallowing distribution on Play Store. | 111 | // Signed by debug key disallowing distribution on Play Store. |
| 111 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. | 112 | // Attaches 'debug' suffix to version and package name, allowing installation alongside the release build. |
| 112 | debug { | 113 | debug { |
| 114 | resValue("string", "app_name_suffixed", "yuzu Debug") | ||
| 113 | isDebuggable = true | 115 | isDebuggable = true |
| 114 | isJniDebuggable = true | 116 | isJniDebuggable = true |
| 115 | versionNameSuffix = "-debug" | 117 | versionNameSuffix = "-debug" |
| 118 | applicationIdSuffix = ".debug" | ||
| 116 | } | 119 | } |
| 117 | } | 120 | } |
| 118 | 121 | ||
| @@ -157,24 +160,42 @@ android { | |||
| 157 | } | 160 | } |
| 158 | } | 161 | } |
| 159 | 162 | ||
| 163 | tasks.getByPath("preBuild").dependsOn("ktlintCheck") | ||
| 164 | |||
| 165 | ktlint { | ||
| 166 | version.set("0.47.1") | ||
| 167 | android.set(true) | ||
| 168 | ignoreFailures.set(false) | ||
| 169 | disabledRules.set( | ||
| 170 | setOf( | ||
| 171 | "no-wildcard-imports", | ||
| 172 | "package-name", | ||
| 173 | "import-ordering" | ||
| 174 | ) | ||
| 175 | ) | ||
| 176 | reporters { | ||
| 177 | reporter(ReporterType.CHECKSTYLE) | ||
| 178 | } | ||
| 179 | } | ||
| 180 | |||
| 160 | dependencies { | 181 | dependencies { |
| 161 | implementation("androidx.core:core-ktx:1.10.1") | 182 | implementation("androidx.core:core-ktx:1.10.1") |
| 162 | implementation("androidx.appcompat:appcompat:1.6.1") | 183 | implementation("androidx.appcompat:appcompat:1.6.1") |
| 163 | implementation("androidx.recyclerview:recyclerview:1.3.0") | 184 | implementation("androidx.recyclerview:recyclerview:1.3.0") |
| 164 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") | 185 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 165 | implementation("androidx.fragment:fragment-ktx:1.5.7") | 186 | implementation("androidx.fragment:fragment-ktx:1.6.0") |
| 166 | implementation("androidx.documentfile:documentfile:1.0.1") | 187 | implementation("androidx.documentfile:documentfile:1.0.1") |
| 167 | implementation("com.google.android.material:material:1.9.0") | 188 | implementation("com.google.android.material:material:1.9.0") |
| 168 | implementation("androidx.preference:preference:1.2.0") | 189 | implementation("androidx.preference:preference:1.2.0") |
| 169 | implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") | 190 | implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") |
| 170 | implementation("io.coil-kt:coil:2.2.2") | 191 | implementation("io.coil-kt:coil:2.2.2") |
| 171 | implementation("androidx.core:core-splashscreen:1.0.1") | 192 | implementation("androidx.core:core-splashscreen:1.0.1") |
| 172 | implementation("androidx.window:window:1.0.0") | 193 | implementation("androidx.window:window:1.1.0") |
| 173 | implementation("org.ini4j:ini4j:0.5.4") | 194 | implementation("org.ini4j:ini4j:0.5.4") |
| 174 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") | 195 | implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 175 | implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") | 196 | implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0") |
| 176 | implementation("androidx.navigation:navigation-fragment-ktx:2.5.3") | 197 | implementation("androidx.navigation:navigation-fragment-ktx:2.6.0") |
| 177 | implementation("androidx.navigation:navigation-ui-ktx:2.5.3") | 198 | implementation("androidx.navigation:navigation-ui-ktx:2.6.0") |
| 178 | implementation("info.debatty:java-string-similarity:2.0.0") | 199 | implementation("info.debatty:java-string-similarity:2.0.0") |
| 179 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") | 200 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0") |
| 180 | } | 201 | } |