feat: automate version.g.dart generation via build_runner

Replace manual generate_version.dart script with a custom build_runner
builder that automatically generates lib/version.g.dart from pubspec.yaml
during the build process. This eliminates manual steps and ensures version
info stays in sync.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 17:27:10 +01:00
co-authored by Claude Opus 4.5
parent 3af4fd16f8
commit 4b0c6b292a
6 changed files with 67 additions and 52 deletions
+8 -1
View File
@@ -129,7 +129,9 @@ flutter run # Default device
### Code Generation
After modifying any `@freezed`, `@JsonSerializable`, or `@riverpod` annotated code:
Run build_runner after modifying:
- `@freezed`, `@JsonSerializable`, or `@riverpod` annotated code
- `pubspec.yaml` version (auto-generates `lib/version.g.dart`)
```bash
dart run build_runner build --delete-conflicting-outputs
@@ -138,6 +140,11 @@ dart run build_runner build --delete-conflicting-outputs
dart run build_runner watch --delete-conflicting-outputs
```
**Generated files**:
- `*.freezed.dart` - Freezed immutable classes
- `*.g.dart` - JSON serialization, Riverpod providers
- `lib/version.g.dart` - App version from pubspec.yaml
## Deployment
### Web (Docker)