Android product flavors (.dev/.staging suffixes, prod clean) + per-flavor
Dart entrypoints, dart-define env files, and per-flavor Firebase config for
both platforms across 3 projects (halobestie-clone-dev / my-bestie-876ec /
my-bestie-production).
- Android: flavorDimensions("env") + productFlavors; @string/app_name label;
per-flavor src/<flavor>/google-services.json (clients verified to match each
applicationId).
- iOS: customer app re-based to the EXISTING App Store identity
com.asc.hallobestie (dev/staging suffix it; ships as an update to the live
app). mitra is a new app (com.mybestie.mitra). Per-flavor plists staged in
ios/config/<flavor>/; Xcode scheme wiring deferred (Mac follow-up).
- firebase_options_{dev,staging,prod}.dart filled with real android + iOS
values (regenerated from the native config files).
- BUILD_FLAVORS.md per app documents flavor table, build commands, iOS
identity decision, and the remaining iOS Xcode steps.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
84 lines
2.8 KiB
Kotlin
84 lines
2.8 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
// START: FlutterFire Configuration
|
|
id("com.google.gms.google-services")
|
|
// END: FlutterFire Configuration
|
|
id("kotlin-android")
|
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
|
id("dev.flutter.flutter-gradle-plugin")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.mybestie"
|
|
compileSdk = flutter.compileSdkVersion
|
|
ndkVersion = flutter.ndkVersion
|
|
|
|
compileOptions {
|
|
isCoreLibraryDesugaringEnabled = true
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
}
|
|
|
|
defaultConfig {
|
|
// Base application ID. Per-flavor suffixes below produce the final IDs:
|
|
// dev -> com.mybestie.dev
|
|
// staging -> com.mybestie.staging
|
|
// prod -> com.mybestie
|
|
applicationId = "com.mybestie"
|
|
// You can update the following values to match your application needs.
|
|
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
|
minSdk = 24
|
|
targetSdk = flutter.targetSdkVersion
|
|
versionCode = flutter.versionCode
|
|
versionName = flutter.versionName
|
|
}
|
|
|
|
// Build flavors for the three environments. Each flavor:
|
|
// - sets its final applicationId (via suffix, except prod)
|
|
// - injects an `app_name` string resource consumed by
|
|
// AndroidManifest.xml's android:label="@string/app_name"
|
|
// - selects its own Firebase config via the matching source set
|
|
// (android/app/src/<flavor>/google-services.json)
|
|
// NOTE: once these flavors exist, a bare `flutter build apk` (no --flavor)
|
|
// fails. All build/install/run commands MUST pass --flavor. See
|
|
// BUILD_FLAVORS.md.
|
|
flavorDimensions += "env"
|
|
productFlavors {
|
|
create("dev") {
|
|
dimension = "env"
|
|
applicationIdSuffix = ".dev"
|
|
resValue("string", "app_name", "HaloBestie Dev")
|
|
}
|
|
create("staging") {
|
|
dimension = "env"
|
|
applicationIdSuffix = ".staging"
|
|
resValue("string", "app_name", "HaloBestie Staging")
|
|
}
|
|
create("prod") {
|
|
dimension = "env"
|
|
// No applicationIdSuffix -> final applicationId stays "com.mybestie".
|
|
resValue("string", "app_name", "HaloBestie")
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
// TODO: Add your own signing config for the release build.
|
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
signingConfig = signingConfigs.getByName("debug")
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
|
}
|
|
|
|
flutter {
|
|
source = "../.."
|
|
}
|