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.

View File

@@ -62,6 +62,25 @@
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:1068156046511:android:1f589ed358ccdad0b8185a",
"android_client_info": {
"package_name": "com.mybestie.dev"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDFWlLSWytqwI7LSdUbVrO7J5De9L2LV2U"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:1068156046511:android:8a873c8b7e64410ab8185a",
@@ -80,6 +99,25 @@
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:1068156046511:android:f527c763dea3dc36b8185a",
"android_client_info": {
"package_name": "com.mybestie.mitra.dev"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDFWlLSWytqwI7LSdUbVrO7J5De9L2LV2U"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"

View File

@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="Mitra HaloBestie"
android:label="@string/app_name"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:usesCleartextTraffic="true">

View File

@@ -0,0 +1,106 @@
{
"project_info": {
"project_number": "953866659887",
"project_id": "my-bestie-production",
"storage_bucket": "my-bestie-production.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:953866659887:android:55dfbf97ac7c26e7183eda",
"android_client_info": {
"package_name": "com.mybestie"
}
},
"oauth_client": [
{
"client_id": "953866659887-5a62u0tdce92i0gmfo0gf3dt0dnlre42.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie",
"certificate_hash": "3c43db3c9ac7f6d7e2fa03b8dbcaf7e5d12c97f3"
}
},
{
"client_id": "953866659887-kebg3eijcomtv97q6v03fm8i30kj7r9r.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie",
"certificate_hash": "7119b6cf7091074759450c899191905a5a4d0369"
}
},
{
"client_id": "953866659887-vvur2mnmbu8ljmnmmg01hqsrj0ocssu9.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie",
"certificate_hash": "6e23f0164af04ddf200f769c460caac3ee2b91ac"
}
},
{
"client_id": "953866659887-9ro36er68qupv00rgokjignnu2hs85v8.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAxAp8hcXO-P7HwwVsS3vFe0OX5ZkIyyWI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "953866659887-9ro36er68qupv00rgokjignnu2hs85v8.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "953866659887-bsb3c2a6ir10u47q8vcacre2tmnk59jb.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.asc.hallobestie"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:953866659887:android:a4b99d675b0b0315183eda",
"android_client_info": {
"package_name": "com.mybestie.mitra"
}
},
"oauth_client": [
{
"client_id": "953866659887-9ro36er68qupv00rgokjignnu2hs85v8.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAxAp8hcXO-P7HwwVsS3vFe0OX5ZkIyyWI"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "953866659887-9ro36er68qupv00rgokjignnu2hs85v8.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "953866659887-bsb3c2a6ir10u47q8vcacre2tmnk59jb.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.asc.hallobestie"
}
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -0,0 +1,29 @@
PROD flavor — google-services.json goes HERE
============================================
This directory is the `prod` flavor source set. The Google Services Gradle
plugin reads `android/app/src/prod/google-services.json` when you build the
prod flavor. It is intentionally MISSING right now.
To make the prod flavor build:
1. In the Firebase Console (the PRODUCTION project), add an Android app with
package name:
com.mybestie.mitra
(prod has NO applicationIdSuffix — it keeps the base id.)
2. Download the generated `google-services.json`.
3. Drop it in this folder, replacing this README:
android/app/src/prod/google-services.json
4. Also run `flutterfire configure` for the production project/package and paste
the generated Dart values into:
lib/firebase/firebase_options_prod.dart
DO NOT copy the dev google-services.json here and edit it by hand — the
mobilesdk_app_id / api_key must come from the real Firebase registration.

View File

@@ -0,0 +1,142 @@
{
"project_info": {
"project_number": "650461407929",
"project_id": "my-bestie-876ec",
"storage_bucket": "my-bestie-876ec.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:650461407929:android:92d95eb766802bcf504968",
"android_client_info": {
"package_name": "com.mybestie"
}
},
"oauth_client": [
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOPkPJkHXLFzo9ICOHyjee2Vn_EUqt1Pc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "650461407929-2o7eo5ts2k389pa3l16sq26l3107b52f.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.halloBestie"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:650461407929:android:7571ae8d5036de5d504968",
"android_client_info": {
"package_name": "com.mybestie.mitra.staging"
}
},
"oauth_client": [
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOPkPJkHXLFzo9ICOHyjee2Vn_EUqt1Pc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "650461407929-2o7eo5ts2k389pa3l16sq26l3107b52f.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.halloBestie"
}
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:650461407929:android:05754df9552e0529504968",
"android_client_info": {
"package_name": "com.mybestie.staging"
}
},
"oauth_client": [
{
"client_id": "650461407929-3els6l9cegtiphe930vtjr80ffa2p1uv.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie.staging",
"certificate_hash": "a46c19a615b3c21b529240dabc8f1cd68bcbd449"
}
},
{
"client_id": "650461407929-8lo71sr668gvvj0ntpjjemoqrkr82uid.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie.staging",
"certificate_hash": "6e23f0164af04ddf200f769c460caac3ee2b91ac"
}
},
{
"client_id": "650461407929-lmj6n5jt818fkdjhjpbhabdd19g82f48.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.mybestie.staging",
"certificate_hash": "937ecfa181a695a5f1fb5d04df15e490c174caea"
}
},
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAOPkPJkHXLFzo9ICOHyjee2Vn_EUqt1Pc"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "650461407929-ofuff9cv8d4fj79efj9e2ovt2nj9b83a.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "650461407929-2o7eo5ts2k389pa3l16sq26l3107b52f.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.example.halloBestie"
}
}
]
}
}
}
],
"configuration_version": "1"
}

View File

@@ -0,0 +1,30 @@
STAGING flavor — google-services.json goes HERE
================================================
This directory is the `staging` flavor source set. The Google Services Gradle
plugin reads `android/app/src/staging/google-services.json` when you build the
staging flavor. It is intentionally MISSING right now.
To make the staging flavor build:
1. In the Firebase Console (the staging / nonprod project), add an Android app
with package name:
com.mybestie.mitra.staging
(note the `.staging` suffix — set by `applicationIdSuffix` in
android/app/build.gradle.kts).
2. Download the generated `google-services.json`.
3. Drop it in this folder, replacing this README:
android/app/src/staging/google-services.json
4. Also run `flutterfire configure` for that project/package and paste the
generated Dart values into:
lib/firebase/firebase_options_staging.dart
DO NOT copy the dev google-services.json here and edit it by hand — the
mobilesdk_app_id / api_key must come from the real Firebase registration.