summaryrefslogtreecommitdiff
path: root/src/android/app/build.gradle.kts
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/app/build.gradle.kts')
-rw-r--r--src/android/app/build.gradle.kts48
1 files changed, 37 insertions, 11 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index d4698ae1c..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
4import android.annotation.SuppressLint 4import android.annotation.SuppressLint
5import kotlin.collections.setOf
6import org.jetbrains.kotlin.konan.properties.Properties
7import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
5 8
6plugins { 9plugins {
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")
@@ -152,6 +160,24 @@ android {
152 } 160 }
153} 161}
154 162
163tasks.getByPath("preBuild").dependsOn("ktlintCheck")
164
165ktlint {
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
155dependencies { 181dependencies {
156 implementation("androidx.core:core-ktx:1.10.1") 182 implementation("androidx.core:core-ktx:1.10.1")
157 implementation("androidx.appcompat:appcompat:1.6.1") 183 implementation("androidx.appcompat:appcompat:1.6.1")