From 1d1621bcb362e55d9afb5b591a025f62eebc1928 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 17 Mar 2025 22:16:41 +0100 Subject: [PATCH] use firebase mocks to setup the repo --- scripts/mocks/mock_constants.dart | 4 ++++ scripts/mocks/mock_firebase.json | 30 ++++++++++++++++++++++++ scripts/mocks/mock_firebase_options.dart | 7 ++++++ scripts/setup_fork.sh | 22 +++++++---------- 4 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 scripts/mocks/mock_constants.dart create mode 100644 scripts/mocks/mock_firebase.json create mode 100644 scripts/mocks/mock_firebase_options.dart diff --git a/scripts/mocks/mock_constants.dart b/scripts/mocks/mock_constants.dart new file mode 100644 index 0000000..386e77e --- /dev/null +++ b/scripts/mocks/mock_constants.dart @@ -0,0 +1,4 @@ +const String contactEmail = ''; +const String iapServerUrl = ''; +const String issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues/new/choose'; +const String sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter/'; diff --git a/scripts/mocks/mock_firebase.json b/scripts/mocks/mock_firebase.json new file mode 100644 index 0000000..82b8b47 --- /dev/null +++ b/scripts/mocks/mock_firebase.json @@ -0,0 +1,30 @@ +{ + "flutter": { + "platforms": { + "android": { + "default": { + "projectId": "mockproject-1234", + "appId": "1:123456789000:android:f1bf012572b04063", + "fileOutput": "android/app/google-services.json" + } + }, + "ios": { + "default": { + "projectId": "mockproject-1234", + "appId": "1:123456789000:ios:f1bf012572b04063", + "uploadDebugSymbols": true, + "fileOutput": "ios/Runner/GoogleService-Info.plist" + } + }, + "dart": { + "lib/firebase_options.dart": { + "projectId": "mockproject-1234", + "configurations": { + "android": "1:123456789000:android:f1bf012572b04063", + "ios": "1:123456789000:ios:f1bf012572b04063" + } + } + } + } + } +} diff --git a/scripts/mocks/mock_firebase_options.dart b/scripts/mocks/mock_firebase_options.dart new file mode 100644 index 0000000..51bc343 --- /dev/null +++ b/scripts/mocks/mock_firebase_options.dart @@ -0,0 +1,7 @@ +// ignore_for_file: type=lint +import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; + +class DefaultFirebaseOptions { + static FirebaseOptions get currentPlatform => + FirebaseOptions(apiKey: '', appId: '', messagingSenderId: '', projectId: ''); +} diff --git a/scripts/setup_fork.sh b/scripts/setup_fork.sh index 1de63df..1b1c3ee 100644 --- a/scripts/setup_fork.sh +++ b/scripts/setup_fork.sh @@ -1,16 +1,12 @@ -constants="const String contactEmail = ''; -const String iapServerUrl = ''; -const String issuesReportUrl = 'https://github.com/vodemn/m3_lightmeter/issues/new/choose'; -const String sourceCodeUrl = 'https://github.com/vodemn/m3_lightmeter/';" +cp "scripts/mocks/mock_constants.dart" "lib/constants.dart" +cp "scripts/mocks/mock_firebase_options.dart" "lib/firebase_options.dart" +cp "scripts/mocks/mock_firebase.json" "firebase.json" -firebase_options="// ignore_for_file: type=lint -import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; +curl -H 'Accept: application/vnd.github.v3.raw' \ + -o "android/app/google-services.json" \ + -L "https://api.github.com/repos/firebase/quickstart-android/contents/mock-google-services.json" +curl -H 'Accept: application/vnd.github.v3.raw' \ + -o "ios/Runner/GoogleService-Info.plist" \ + -L "https://api.github.com/repos/firebase/quickstart-ios/contents/mock-GoogleService-Info.plist" -class DefaultFirebaseOptions { - static FirebaseOptions get currentPlatform => - FirebaseOptions(apiKey: '', appId: '', messagingSenderId: '', projectId: ''); -}" - -echo "$constants" > "lib/constants.dart" -echo "$firebase_options" > "lib/firebase_options.dart" sh .github/scripts/stub_iap.sh