Files
dsp-thomann-interface/src-tauri/gen/android/app/build.gradle.kts
T
Lucas 191148f9b9
CI / Frontend (push) Successful in 41s
CI / Rust (Tauri backend) (push) Successful in 1m57s
Release / Create release (push) Successful in 1s
Release / Build Linux bundles (push) Successful in 3m44s
Release / Build Android APK (push) Successful in 9m38s
fix: sign android apk
2026-11-04 14:19:22 +01:00

120 lines
3.6 KiB
Kotlin

import java.util.Properties
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("rust")
}
val tauriProperties = Properties().apply {
val propFile = file("tauri.properties")
if (propFile.exists()) {
propFile.inputStream().use { load(it) }
}
}
// Load signing credentials.
// Locally: optional (debug builds and `tauri android dev` work without it).
// In CI: mandatory, so a broken secrets setup fails loudly instead of
// producing an unsigned APK.
val keystoreProperties = Properties().apply {
val keystoreFile = rootProject.file("keystore.properties")
if (keystoreFile.exists()) {
keystoreFile.inputStream().use { load(it) }
} else if (System.getenv("CI") != null) {
error("Missing keystore.properties in CI")
}
}
val hasKeystore = keystoreProperties.containsKey("storeFile")
android {
compileSdk = 36
namespace = "com.lucas.thomann_dsp_app"
defaultConfig {
manifestPlaceholders["usesCleartextTraffic"] = "false"
applicationId = "com.lucas.thomann_dsp_app"
minSdk = 24
targetSdk = 36
versionCode = tauriProperties
.getProperty("tauri.android.versionCode", "1").toInt()
versionName = tauriProperties
.getProperty("tauri.android.versionName", "1.0")
}
signingConfigs {
if (hasKeystore) {
create("release") {
val keystorePath = keystoreProperties.getProperty("storeFile")
?: error("Missing storeFile")
storeFile = rootProject.file(keystorePath)
storePassword = keystoreProperties.getProperty("storePassword")
?: error("Missing storePassword")
keyAlias = keystoreProperties.getProperty("keyAlias")
?: error("Missing keyAlias")
keyPassword = keystoreProperties.getProperty("keyPassword")
?: error("Missing keyPassword")
}
}
}
buildTypes {
getByName("debug") {
manifestPlaceholders["usesCleartextTraffic"] = "true"
isDebuggable = true
isJniDebuggable = true
isMinifyEnabled = false
packaging {
jniLibs.keepDebugSymbols.add("*/arm64-v8a/*.so")
jniLibs.keepDebugSymbols.add("*/armeabi-v7a/*.so")
jniLibs.keepDebugSymbols.add("*/x86/*.so")
jniLibs.keepDebugSymbols.add("*/x86_64/*.so")
}
}
getByName("release") {
isMinifyEnabled = false
if (hasKeystore) {
signingConfig = signingConfigs.getByName("release")
}
proguardFiles(
*fileTree(".") { include("**/*.pro") }
.plus(getDefaultProguardFile("proguard-android-optimize.txt"))
.toList()
.toTypedArray()
)
}
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
buildConfig = true
}
}
rust {
rootDirRel = "../../../"
}
dependencies {
implementation("androidx.webkit:webkit:1.14.0")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.activity:activity-ktx:1.10.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.lifecycle:lifecycle-process:2.10.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.0")
}
apply(from = "tauri.build.gradle.kts")