Compare commits

...

3 commits

Author SHA1 Message Date
Vadim
0e45d98060
ML-221 Spot Metering only available when Histogram is enabled (#225) 2025-03-17 22:43:00 +01:00
Vadim
cf471afdfd
Use Firebase mocks to setup the repo (#224) 2025-03-17 22:18:55 +01:00
Vadim
d95b811d6c
Added script to setup the repo & updated README.md (#223)
* added script to setup the repo

* moved scripts to scripts folder

* Update README.md

* added macOS disclaimer
2025-03-17 21:35:33 +01:00
8 changed files with 62 additions and 36 deletions

View file

@ -38,41 +38,18 @@ To build this app you need to install Flutter 3.24.5 stable. [How to install](ht
### 2. Project setup ### 2. Project setup
#### Restore _constants.dart_ file #### Restore git-ignored files:
Create a file _lib/constants.dart_ and paste the following content: For macOS you can just run the following script:
```dart
const String contactEmail = '';
const String iapServerUrl = '';
const String issuesReportUrl = '';
const String sourceCodeUrl = '';
```
#### Stub IAP package
As part of the app's functionallity is in the private repo, you have to replace these lines in _pubspec.yaml_:
```yaml
m3_lightmeter_iap:
git:
url: "https://github.com/vodemn/m3_lightmeter_iap"
ref: main
```
with these:
```yaml
m3_lightmeter_iap:
path: iap
```
You can do it simply by running the script:
```console ```console
sh .github/scripts/stub_iap.sh sh scripts/setup_fork.sh
``` ```
Or create the files manually using the contents from the script.
#### Get dependencies
> If you are using VSCode, you can open the workspace like so: _File -> Open Workspace from File -> m3_lightmeter.code-workspace_. Otherwise you have to run `flutter pub get` command from the iap folder. > If you are using VSCode, you can open the workspace like so: _File -> Open Workspace from File -> m3_lightmeter.code-workspace_. Otherwise you have to run `flutter pub get` command from the iap folder.
Then you can fetch all the neccessary dependencies and generate translation files by running the following commands: Then you can fetch all the neccessary dependencies and generate translation files by running the following commands:
@ -82,11 +59,7 @@ flutter pub get
flutter pub run intl_utils:generate flutter pub run intl_utils:generate
``` ```
### 3. (Optional) Install Firebase ### 3. Build
Out of the box Firebase Crashlytics won't work. If you want to add Crashlytics to your local build please follow [this guide](https://firebase.google.com/docs/flutter/setup).
### 4. Build
- Checkout [Build .apk](.github/workflows/build_apk.yml) workflow for Android - Checkout [Build .apk](.github/workflows/build_apk.yml) workflow for Android
- Checkout [Build .ipa](.github/workflows/build_ipa.yml) workflow for iOS - Checkout [Build .ipa](.github/workflows/build_ipa.yml) workflow for iOS

View file

@ -132,7 +132,7 @@ class _ProFeaturesOverlay extends StatelessWidget {
); );
final bool hasSpotMetering = UserPreferencesProvider.cameraFeatureOf( final bool hasSpotMetering = UserPreferencesProvider.cameraFeatureOf(
context, context,
CameraFeature.histogram, CameraFeature.spotMetering,
); );
return Stack( return Stack(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,

View file

@ -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/';

View file

@ -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"
}
}
}
}
}
}

View file

@ -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: '');
}

12
scripts/setup_fork.sh Normal file
View file

@ -0,0 +1,12 @@
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"
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"
sh .github/scripts/stub_iap.sh