diff --git a/.gitignore b/.gitignore index ffa3eff..a9d2af3 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,11 @@ app.*.map.json # Secrets app/lib/secrets/ !app/lib/secrets/app_secrets.skeleton.dart - +# Omit committing pubspec_overrides.yaml +pubspec_overrides.yaml # Omit committing pubspec.lock for library packages; see # https://dart.dev/guides/libraries/private-files#pubspeclock. -pubspec.lock \ No newline at end of file +pubspec.lock +# Omit committing coverage +coverage +.idea \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a5e60a2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "conventionalCommits.scopes": [ + "melos" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index ba97c15..f83392f 100644 --- a/README.md +++ b/README.md @@ -94,17 +94,56 @@ especially public ones. To keep such data safe the template uses `app_secrets.da want to run the app locally, you will need to create a new file `app_secrets.dart` under [`lib/secrets`](app/lib/secrets). To help with setting up the secrets file, the template inclued a skeleton secrets file. +#### Clear Build Cache + +```bash +melos clean +``` #### Get Dependencies ```bash melos run get ``` - #### Run Code Generation +Instead of running + +``melos run generate`` + +Just use below commands for code generation +```bash +melos bs +Or +melos bootstrap + +``` +#### Run Test Cases + +To run test cases for a specific package +use following command + + +```bash +melos test:selective_unit_test +``` +``` +1) * [Default - Press Enter] +2) app +3) localisation +4) services +5) statemanagement_bloc +6) statemanagement_core +7) statemanagement_riverpod +8) themes +? Enter your choice +``` +You will see the interface described above. +Pick the package for which you want to execute test cases. + +To run all test cases run below command ```bash -melos run generate +melos test ``` #### Setup Hooks @@ -458,4 +497,4 @@ upcoming [enhancements](https://github.com/NeoSOFT-Technologies/mobile-flutter/i ## Contributing to this Project Contributions are welcome from anyone and everyone. We encourage you to review -the [Guiding principles for contributing](CONTRIBUTING.md) \ No newline at end of file +the [Guiding principles for contributing](CONTRIBUTING.md) diff --git a/app/.gitignore b/app/.gitignore index 163f9cd..2cc2692 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -33,7 +33,6 @@ migrate_working_dir/ /build/ # Web related -lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/melos.yaml b/melos.yaml index 187c3bc..b174164 100644 --- a/melos.yaml +++ b/melos.yaml @@ -12,12 +12,19 @@ packages: - statemanagement-riverpod - themes +# Run command melos bs or melos bootstrap +command: + bootstrap: + hooks: + pre: echo `Running flutter pub get` + post: melos run generate + scripts: clean-all: run: melos run build-clean && melos run flutter-clean - - flutter-clean: - exec: flutter clean + + get: + run: melos exec flutter pub get build-clean: run: melos exec --scope="app,data,domain,database_floor,network_retrofit,themes" flutter pub run build_runner clean @@ -25,9 +32,6 @@ scripts: generate: run: melos exec --scope="app,data,domain,database_floor,network_retrofit,themes" -- flutter pub run build_runner build --delete-conflicting-outputs - get: - exec: flutter pub get - tidy: run: melos run format && melos run dart-fix @@ -39,6 +43,33 @@ scripts: dart-fix: exec: dart fix --apply + + # Build apps for specific platform + # customize the target as per your need + build_web: + run: melos exec --scope="app" flutter build web --release --target=lib/entrypoints/main_prod.dart + + # To generate the app bundle just replace flutter build apk --split-per-abi with appbundle + build_android: + run: melos exec --scope="app" flutter build apk --split-per-abi --obfuscate --split-debug-info=app/`$PWD` --flavor nps -t lib/entrypoints/main_prod.dart + + + + # lib/entrypoints/main_qa.dart + + + # To run all test cases test: - exec: flutter test --exclude-tags=golden + run: melos run test:selective_unit_test --no-select + description: Run all Flutter tests in this project. + + + + # To run the test cases of specific package + test:selective_unit_test: + run: melos exec --dir-exists="test" --fail-fast -- flutter test --exclude-tags=golden --no-pub --coverage + description: "To run test cases of specific package" + packageFilters: + flutter: true + dirExists: "test" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..e6d1237 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,7 @@ +name: flutter_template + +environment: + sdk: ">=2.17.6 <3.0.0" +dev_dependencies: + melos: ^3.0.1 + \ No newline at end of file