Files
ladill-mini/apps/android/app/build.gradle.kts
T
isaaccladandCursor ea6afb80a4
Deploy Ladill Mini / deploy (push) Successful in 35s
Add Ladill Mini native Android and iOS apps.
Ship full-featured mobile clients with auth, payments, QRs, push notifications, and iOS polish including Figtree typography, app icons, and QR previews.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-11 22:30:35 +00:00

126 lines
4.3 KiB
Kotlin

import java.util.Properties
import org.gradle.api.GradleException
val keystoreProperties = Properties().apply {
val file = rootProject.file("keystore.properties")
if (file.exists()) {
file.inputStream().use(::load)
}
}
fun signingProperty(name: String): String? =
keystoreProperties.getProperty(name)
?: providers.gradleProperty(name).orNull
?: providers.environmentVariable(name).orNull
val releaseStoreFile = signingProperty("LADILL_UPLOAD_STORE_FILE") ?: signingProperty("storeFile")
val releaseStorePassword = signingProperty("LADILL_UPLOAD_STORE_PASSWORD") ?: signingProperty("storePassword")
val releaseKeyAlias = signingProperty("LADILL_UPLOAD_KEY_ALIAS") ?: signingProperty("keyAlias")
val releaseKeyPassword = signingProperty("LADILL_UPLOAD_KEY_PASSWORD") ?: signingProperty("keyPassword")
val hasReleaseSigning = listOf(releaseStoreFile, releaseStorePassword, releaseKeyAlias, releaseKeyPassword).all { !it.isNullOrBlank() }
val requestedReleaseBuild = gradle.startParameter.taskNames.any { it.contains("Release", ignoreCase = true) }
if (requestedReleaseBuild && !hasReleaseSigning) {
throw GradleException(
"Release signing is not configured. Create apps/android/keystore.properties with storeFile, storePassword, keyAlias, and keyPassword, or provide LADILL_UPLOAD_STORE_FILE, LADILL_UPLOAD_STORE_PASSWORD, LADILL_UPLOAD_KEY_ALIAS, and LADILL_UPLOAD_KEY_PASSWORD.",
)
}
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
}
if (file("google-services.json").exists()) {
apply(plugin = "com.google.gms.google-services")
}
android {
namespace = "com.ladill.mini"
compileSdk = 35
defaultConfig {
applicationId = "com.ladill.mini"
minSdk = 26
targetSdk = 35
versionCode = 1
versionName = "1.0"
}
signingConfigs {
if (hasReleaseSigning) {
create("release") {
storeFile = rootProject.file(releaseStoreFile!!)
storePassword = releaseStorePassword
keyAlias = releaseKeyAlias
keyPassword = releaseKeyPassword
}
}
}
buildTypes {
debug {
buildConfigField("String", "BASE_URL", "\"https://mini.ladill.com/api/v1/\"")
}
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
buildConfigField("String", "BASE_URL", "\"https://mini.ladill.com/api/v1/\"")
if (hasReleaseSigning) {
signingConfig = signingConfigs.getByName("release")
}
}
}
buildFeatures {
compose = true
buildConfig = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.splashscreen)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.security.crypto)
implementation(libs.androidx.biometric)
implementation(libs.kotlinx.coroutines.android)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material.icons.extended)
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.okhttp)
implementation(libs.okhttp.logging.interceptor)
implementation(libs.coil.compose)
implementation(libs.coil.svg)
implementation(libs.zxing.core)
implementation(platform(libs.firebase.bom))
implementation(libs.firebase.messaging.ktx)
debugImplementation(libs.androidx.compose.ui.tooling)
}