feat(build): add dev/staging/prod flavors for client_app + mitra_app

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>
This commit is contained in:
2026-06-04 22:21:50 +08:00
parent 76d74aa7b5
commit 22743c81e1
53 changed files with 1891 additions and 178 deletions

View File

@@ -21,7 +21,8 @@ android {
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
// Base Application ID. Per-flavor suffixes are applied below in
// productFlavors (dev → .dev, staging → .staging, prod → no suffix).
applicationId = "com.mybestie.mitra"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
@@ -31,6 +32,30 @@ android {
versionName = flutter.versionName
}
// Build flavors: dev / staging / prod. Each gets its own applicationId
// (so all three can be installed side-by-side) and its own app_name string
// resource (consumed by AndroidManifest's android:label="@string/app_name").
// A bare `flutter build`/`flutter run` WITHOUT --flavor now fails — every
// command must pass --flavor and the matching -t entrypoint.
flavorDimensions += "env"
productFlavors {
create("dev") {
dimension = "env"
applicationIdSuffix = ".dev"
resValue("string", "app_name", "Mitra HaloBestie Dev")
}
create("staging") {
dimension = "env"
applicationIdSuffix = ".staging"
resValue("string", "app_name", "Mitra HaloBestie Staging")
}
create("prod") {
dimension = "env"
// No applicationIdSuffix — prod keeps the base com.mybestie.mitra.
resValue("string", "app_name", "Mitra HaloBestie")
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.