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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user