summaryrefslogtreecommitdiffstats
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.kts73
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 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import android.annotation.SuppressLint
+import kotlin.collections.setOf
+import org.jetbrains.kotlin.konan.properties.Properties
+import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-parcelize")
kotlin("plugin.serialization") version "1.8.21"
+ id("androidx.navigation.safeargs.kotlin")
+ id("org.jlleitschuh.gradle.ktlint") version "11.4.0"
}
/**
@@ -42,24 +47,27 @@ android {
jniLibs.useLegacyPackaging = true
}
- lint {
- // This is important as it will run lint but not abort on error
- // Lint has some overly obnoxious "errors" that should really be warnings
- abortOnError = false
-
- //Uncomment disable lines for test builds...
- //disable 'MissingTranslation'bin
- //disable 'ExtraTranslation'
- }
-
defaultConfig {
// TODO If this is ever modified, change application_id in strings.xml
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")
@@ -74,16 +82,7 @@ android {
// Signed by release key, allowing for upload to Play Store.
release {
- signingConfig = signingConfigs.getByName("debug")
- isMinifyEnabled = true
- isDebuggable = false
- proguardFiles(
- getDefaultProguardFile("proguard-android.txt"),
- "proguard-rules.pro"
- )
- }
-
- register("relWithVersionCode") {
+ resValue("string", "app_name_suffixed", "yuzu")
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = true
isDebuggable = false
@@ -96,6 +95,7 @@ android {
// builds a release build that doesn't need signing
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
register("relWithDebInfo") {
+ resValue("string", "app_name_suffixed", "yuzu Debug Release")
signingConfig = signingConfigs.getByName("debug")
isMinifyEnabled = true
isDebuggable = true
@@ -103,16 +103,19 @@ android {
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
- versionNameSuffix = "-debug"
+ versionNameSuffix = "-relWithDebInfo"
+ applicationIdSuffix = ".relWithDebInfo"
isJniDebuggable = true
}
// Signed by debug key disallowing distribution on Play Store.
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
debug {
+ resValue("string", "app_name_suffixed", "yuzu Debug")
isDebuggable = true
isJniDebuggable = true
versionNameSuffix = "-debug"
+ applicationIdSuffix = ".debug"
}
}
@@ -157,24 +160,42 @@ android {
}
}
+tasks.getByPath("preBuild").dependsOn("ktlintCheck")
+
+ktlint {
+ version.set("0.47.1")
+ android.set(true)
+ ignoreFailures.set(false)
+ disabledRules.set(
+ setOf(
+ "no-wildcard-imports",
+ "package-name",
+ "import-ordering"
+ )
+ )
+ reporters {
+ reporter(ReporterType.CHECKSTYLE)
+ }
+}
+
dependencies {
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.recyclerview:recyclerview:1.3.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
- implementation("androidx.fragment:fragment-ktx:1.5.7")
+ implementation("androidx.fragment:fragment-ktx:1.6.0")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.preference:preference:1.2.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
implementation("io.coil-kt:coil:2.2.2")
implementation("androidx.core:core-splashscreen:1.0.1")
- implementation("androidx.window:window:1.0.0")
+ implementation("androidx.window:window:1.1.0")
implementation("org.ini4j:ini4j:0.5.4")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
- implementation("androidx.navigation:navigation-fragment-ktx:2.5.3")
- implementation("androidx.navigation:navigation-ui-ktx:2.5.3")
+ implementation("androidx.navigation:navigation-fragment-ktx:2.6.0")
+ implementation("androidx.navigation:navigation-ui-ktx:2.6.0")
implementation("info.debatty:java-string-similarity:2.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
}