1
0
mirror of https://github.com/nisrulz/flutter-examples.git synced 2026-08-25 01:05:36 +00:00

tools: add make analyze/test/doctor and unify gradle wrappers

- Add scripts/analyze_all.sh and scripts/test_all.sh that run flutter
  analyze/test across every app and report a summary
- Add scripts/repo_doctor.sh that flags config drift (sdk constraint,
  analysis_options, pubspec name, applicationId, gradle version, docs,
  tracked generated files) and exits non-zero for use as a pre-commit gate
- Wire these into the Makefile as 'make analyze/test/doctor' and document
  them in MAINTENANCE.md
- Bring bmi_calculator and push_notifications gradle wrappers up to the
  repo-standard 9.7.0; note push_notifications as a Firebase app requiring
  google-services.json
This commit is contained in:
Nishant Srivastava
2026-08-17 23:48:02 +02:00
parent 47bc829f64
commit 2cf50c0b6b
7 changed files with 232 additions and 3 deletions

View File

@@ -8,6 +8,9 @@ All maintenance commands are available through the `Makefile` at the repository
| --- | --- |
| `make help` | Show all available commands |
| `make packages` | Run `flutter packages get` for all example apps |
| `make analyze` | Run `flutter analyze` for all example apps |
| `make test` | Run `flutter test` for all example apps that have tests |
| `make doctor` | Check every app for configuration drift |
| `make clean-builds` | Move all build folders to trash |
| `make gradle-update` | Upgrade Gradle wrappers to the latest version |
| `make docs` | Regenerate `documentation/EXAMPLES.md` from the app folders |
@@ -16,6 +19,17 @@ All maintenance commands are available through the `Makefile` at the repository
`make gradle-update` upgrades the Gradle wrapper of every example app.
## Drift checks
`make doctor` scans every example app and reports configuration drift: non-standard
SDK constraints, missing `analysis_options.yaml` or `flutter_lints`, pubspec names
that do not match their folder, Android `applicationId`s outside the
`github.nisrulz.*` convention, non-standard Gradle versions, apps missing from
`EXAMPLES.md`, and generated files accidentally tracked in git. It exits non-zero
when issues are found, so you can use it as a pre-commit gate.
Run `make analyze` after changing any app to confirm `flutter analyze` is clean.
| Option | Description |
| --- | --- |
| `VERSION=<x.y.z>` | Target a specific Gradle version. Default: latest from GitHub |
@@ -37,6 +51,7 @@ in `<app>/android/app/` before they can be built:
- `firebase_google_authentication`
- `google_signin`
- `push_notifications`
- `using_firebase_db`
The file is never committed because it contains your Firebase project config.