2026-02-07 14:17:07 -08:00
|
|
|
import java.io.FileInputStream
|
|
|
|
|
import java.util.Properties
|
|
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
|
id("com.android.application")
|
|
|
|
|
id("com.google.gms.google-services")
|
|
|
|
|
id("com.google.firebase.firebase-perf")
|
|
|
|
|
id("com.google.firebase.crashlytics")
|
|
|
|
|
id("kotlin-android")
|
|
|
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
|
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val keystoreProperties = Properties()
|
|
|
|
|
val keystorePropertiesFile = rootProject.file("key.properties")
|
|
|
|
|
if (keystorePropertiesFile.exists()) {
|
|
|
|
|
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
android {
|
|
|
|
|
namespace = "com.tommychow.frosty"
|
|
|
|
|
compileSdk = flutter.compileSdkVersion
|
|
|
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
|
applicationId = "com.tommychow.frosty"
|
|
|
|
|
minSdk = flutter.minSdkVersion
|
|
|
|
|
targetSdk = flutter.targetSdkVersion
|
|
|
|
|
versionCode = flutter.versionCode
|
|
|
|
|
versionName = flutter.versionName
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
|
create("release") {
|
|
|
|
|
keyAlias = keystoreProperties["keyAlias"] as String?
|
|
|
|
|
keyPassword = keystoreProperties["keyPassword"] as String?
|
|
|
|
|
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
|
|
|
|
|
storePassword = keystoreProperties["storePassword"] as String?
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
|
release {
|
2026-06-08 23:15:38 -07:00
|
|
|
// Use the real upload key when key.properties is present (release
|
|
|
|
|
// workflows create it from secrets). Allow debug signing only when a CI
|
|
|
|
|
// compile-only check explicitly opts in via ALLOW_DEBUG_SIGNED_RELEASE;
|
|
|
|
|
// otherwise fail loudly so a real release can never be silently
|
|
|
|
|
// debug-signed if the keystore step is ever missing.
|
|
|
|
|
signingConfig = when {
|
|
|
|
|
keystorePropertiesFile.exists() -> signingConfigs.getByName("release")
|
|
|
|
|
System.getenv("ALLOW_DEBUG_SIGNED_RELEASE") != null -> signingConfigs.getByName("debug")
|
|
|
|
|
else -> error("key.properties missing — set ALLOW_DEBUG_SIGNED_RELEASE=1 for compile-only builds")
|
|
|
|
|
}
|
2026-02-07 14:17:07 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flutter {
|
|
|
|
|
source = "../.."
|
|
|
|
|
}
|