summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2024-02-07 21:32:42 +0100
committerGitHub <noreply@github.com>2024-02-07 21:32:42 +0100
commitc000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14 (patch)
tree8b1313997429d923ea6895f58099fc32ac265448 /src
parentMerge pull request #12883 from FernandoS27/memory_manager_mem (diff)
parentci: android: Play store publishing setup (diff)
downloadyuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar.gz
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar.bz2
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar.lz
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar.xz
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.tar.zst
yuzu-c000a5ff09aa20b8e8c2d4d0d365fd21d9b32b14.zip
Diffstat (limited to 'src')
-rw-r--r--src/android/app/build.gradle.kts31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts
index 188ef9469..d44bb4c74 100644
--- a/src/android/app/build.gradle.kts
+++ b/src/android/app/build.gradle.kts
@@ -3,8 +3,8 @@
import android.annotation.SuppressLint
import kotlin.collections.setOf
-import org.jetbrains.kotlin.konan.properties.Properties
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
+import com.github.triplet.gradle.androidpublisher.ReleaseStatus
plugins {
id("com.android.application")
@@ -13,6 +13,7 @@ plugins {
kotlin("plugin.serialization") version "1.9.20"
id("androidx.navigation.safeargs.kotlin")
id("org.jlleitschuh.gradle.ktlint") version "11.4.0"
+ id("com.github.triplet.play") version "3.8.6"
}
/**
@@ -58,15 +59,7 @@ android {
targetSdk = 34
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") {
+ versionCode = if (System.getenv("AUTO_VERSIONED") == "true") {
autoVersion
} else {
1
@@ -221,6 +214,15 @@ ktlint {
}
}
+play {
+ val keyPath = System.getenv("SERVICE_ACCOUNT_KEY_PATH")
+ if (keyPath != null) {
+ serviceAccountCredentials.set(File(keyPath))
+ }
+ track.set(System.getenv("STORE_TRACK") ?: "internal")
+ releaseStatus.set(ReleaseStatus.COMPLETED)
+}
+
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.appcompat:appcompat:1.6.1")
@@ -257,14 +259,13 @@ fun runGitCommand(command: List<String>): String {
}
fun getGitVersion(): String {
+ val gitVersion = runGitCommand(listOf("git", "describe", "--always", "--long"))
val versionName = if (System.getenv("GITHUB_ACTIONS") != null) {
- val gitTag = System.getenv("GIT_TAG_NAME") ?: ""
- gitTag
+ System.getenv("GIT_TAG_NAME") ?: gitVersion
} else {
- runGitCommand(listOf("git", "describe", "--always", "--long"))
- .replace(Regex("(-0)?-[^-]+$"), "")
+ gitVersion
}
- return versionName.ifEmpty { "0.0" }
+ return versionName.replace(Regex("(-0)?-[^-]+$"), "").ifEmpty { "0.0" }
}
fun getGitHash(): String =