Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generator support for GenerateAdapters annotation #35

Merged
merged 112 commits into from
Nov 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
44fed27
Almost there
Rexios80 Oct 18, 2024
65c688c
This is hard
Rexios80 Oct 18, 2024
5dfdcd1
Almost there
Rexios80 Oct 18, 2024
0fcfc14
What a mess
Rexios80 Oct 18, 2024
4680806
...
Rexios80 Oct 18, 2024
058bc7e
...
Rexios80 Oct 18, 2024
4f1ad99
...
Rexios80 Oct 18, 2024
17be7ae
...
Rexios80 Oct 18, 2024
071244f
...
Rexios80 Oct 18, 2024
0a567d4
...
Rexios80 Oct 18, 2024
aec65d2
...
Rexios80 Oct 18, 2024
e93e120
...
Rexios80 Oct 18, 2024
472aadb
Add special handling for ignored enum fields
Rexios80 Oct 19, 2024
5056d65
Ignore all fields on Object and Enum
Rexios80 Oct 19, 2024
92f9032
...
Rexios80 Oct 19, 2024
5714d48
...
Rexios80 Oct 19, 2024
c5e667d
...
Rexios80 Oct 19, 2024
2bbcc88
...
Rexios80 Oct 19, 2024
73b8863
Cleanup
Rexios80 Oct 19, 2024
66f07e1
Documentation
Rexios80 Oct 19, 2024
4ee5fda
Cleanup
Rexios80 Oct 19, 2024
7532405
Cleanup
Rexios80 Oct 19, 2024
196bcd8
...
Rexios80 Oct 19, 2024
fe83e39
...
Rexios80 Oct 19, 2024
b50676b
Working on documentation
Rexios80 Oct 19, 2024
1abfb3d
...
Rexios80 Oct 20, 2024
2a7f14e
...
Rexios80 Oct 20, 2024
d5eff44
Add migration guide
Rexios80 Oct 20, 2024
d84bdc6
...
Rexios80 Oct 20, 2024
f4fd915
Ignore static fields
Rexios80 Oct 20, 2024
4fb7c38
...
Rexios80 Oct 20, 2024
296592c
Switch to SharedPartBuilder for GenerateAdapters
Rexios80 Oct 20, 2024
aec3af8
Properly sort types
Rexios80 Oct 20, 2024
3fa9fd3
...
Rexios80 Oct 20, 2024
eeee9fe
Ignore getters without setters
Rexios80 Oct 20, 2024
a67fc17
Attempt 2 for this
Rexios80 Oct 20, 2024
a1eea4a
...
Rexios80 Oct 20, 2024
fc7f944
...
Rexios80 Oct 20, 2024
edebf3a
Only generate one id per field name
Rexios80 Oct 20, 2024
0b3be9f
Cleanup
Rexios80 Oct 21, 2024
abb0270
Working on documentation
Rexios80 Oct 21, 2024
64d676a
Convert example to GenerateAdapters
Rexios80 Oct 21, 2024
9d0176a
First test
Rexios80 Oct 21, 2024
e37d3f7
Initial tests
Rexios80 Oct 21, 2024
bd9ce0e
More tests
Rexios80 Oct 21, 2024
01d4b70
...
Rexios80 Oct 21, 2024
d89d73a
...
Rexios80 Oct 21, 2024
3bd8a00
Update references to old hive repo
Rexios80 Oct 21, 2024
1f123f0
...
Rexios80 Oct 21, 2024
fdddccb
Read hive_schema.yaml through the buildStep so changes affect builds
Rexios80 Oct 21, 2024
6a5a38e
...
Rexios80 Oct 21, 2024
a1cc280
Add codecov.yml
Rexios80 Oct 21, 2024
2a1e401
...
Rexios80 Oct 21, 2024
af4512d
Ignore constructors for coverage
Rexios80 Oct 21, 2024
ec6e8d7
Ignore non-static fields on enums
Rexios80 Oct 21, 2024
4c43e23
Schema validation
Rexios80 Oct 22, 2024
86ad76d
Place `hive_registrar.g.dart` with the `GenerateAdapters` annotation …
Rexios80 Oct 23, 2024
7a0792d
Add tests for registrar generation
Rexios80 Oct 23, 2024
1ceb434
Updating documentation
Rexios80 Oct 23, 2024
79b3150
Regenerate
Rexios80 Oct 23, 2024
e30faf7
Merge branch 'main' into feature/generate-adapters
Rexios80 Oct 23, 2024
6ca6bf5
Fix analysis in generated files
Rexios80 Oct 23, 2024
1f47cb8
...
Rexios80 Oct 23, 2024
62b0bd0
Do not run build_runner in hive_generator
Rexios80 Oct 23, 2024
0cea303
Add more details to registrar generation errors
Rexios80 Oct 25, 2024
64a3f7c
Fix tests
Rexios80 Oct 25, 2024
4ddce35
Sort uris in error for testing
Rexios80 Oct 25, 2024
9b8f093
Formatting
Rexios80 Oct 25, 2024
04c5cc3
Update grammar
Rexios80 Oct 25, 2024
bf2ef97
Respect configured ignores in registrar builder
Rexios80 Oct 28, 2024
90691c4
Merge branch 'main' into feature/generate-adapters
Rexios80 Oct 28, 2024
a43c060
Use correct version
Rexios80 Oct 28, 2024
bf2f873
...
Rexios80 Oct 28, 2024
cf18879
Regenerate mocks
Rexios80 Oct 28, 2024
d895cbb
Rename file
Rexios80 Oct 29, 2024
faeca12
Merge remote-tracking branch 'origin/main' into feature/generate-adap…
Rexios80 Oct 29, 2024
66e3345
Merge branch 'main' into feature/generate-adapters
Rexios80 Nov 1, 2024
055ce88
Update readme
Rexios80 Nov 1, 2024
2f56899
Merge branch 'main' into feature/generate-adapters
Rexios80 Nov 5, 2024
f30b1b7
Refactoring
Rexios80 Nov 5, 2024
6242699
...
Rexios80 Nov 5, 2024
5cd9ab7
Wrote the migrator
Rexios80 Nov 5, 2024
4e6bb8c
Testing works
Rexios80 Nov 5, 2024
5f415aa
...
Rexios80 Nov 5, 2024
a27e50f
Update readme
Rexios80 Nov 5, 2024
8893735
...
Rexios80 Nov 5, 2024
26381be
...
Rexios80 Nov 5, 2024
bc92b1a
...
Rexios80 Nov 5, 2024
d59a424
...
Rexios80 Nov 5, 2024
1f91041
...
Rexios80 Nov 5, 2024
53e3a7d
Sanitize field names
Rexios80 Nov 5, 2024
5078064
Update migration guide
Rexios80 Nov 6, 2024
c726879
Better error handling for migration tool
Rexios80 Nov 7, 2024
d658041
...
Rexios80 Nov 7, 2024
b97f6c7
...
Rexios80 Nov 7, 2024
1b2040f
...
Rexios80 Nov 7, 2024
3fbbb11
Update tests
Rexios80 Nov 7, 2024
ba5e9dc
Fix enum handling
Rexios80 Nov 7, 2024
568459b
Fix typo
Rexios80 Nov 7, 2024
5a3294a
Handle multiple GenerateAdapters on same element
Rexios80 Nov 7, 2024
e88bd1d
...
Rexios80 Nov 7, 2024
0cf8773
...
Rexios80 Nov 7, 2024
f2e7119
...
Rexios80 Nov 7, 2024
22d98aa
Generate hive_adapters.dart during migration
Rexios80 Nov 12, 2024
1c0ad8c
Force write as string so migrated files don't get deleted on next build
Rexios80 Nov 12, 2024
50afc8a
Handle possible schema mismatches in migration tool
Rexios80 Nov 13, 2024
5d58b64
Fix issue with setter names
Rexios80 Nov 13, 2024
4f06756
Fix error output
Rexios80 Nov 13, 2024
3b321f5
Merge branch 'feature/generate-adapters-annotation' into feature/gene…
Rexios80 Nov 13, 2024
f72bb88
Revert example dependency override
Rexios80 Nov 13, 2024
65bf44c
Merge branch 'main' into feature/generate-adapters
Rexios80 Nov 19, 2024
d58565b
Remove dependency override
Rexios80 Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
...
Rexios80 committed Oct 19, 2024

Verified

This commit was signed with the committer’s verified signature.
Rexios80 Rexios
commit fe83e3917e7b24e5dcf32988061e798dde593f0d
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ jobs:
- name: Run tests
run: dart test -p ${{ matrix.test-platform }} -c ${{ matrix.compiler }}

test-hive-flutter:
test-hive_flutter:
runs-on: ubuntu-latest
strategy:
matrix:
@@ -85,7 +85,7 @@ jobs:
flutter-channel: [stable, beta]
defaults:
run:
working-directory: hive_generator
working-directory: hive_generator/example
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Generated by Hive CE
// Do not modify
// Check into version control

import 'package:hive_ce/hive.dart';
import 'package:example/freezed.dart';
import 'package:example/main.dart';
2 changes: 1 addition & 1 deletion hive/example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'dart:io';

import 'package:example/hive_registrar.g.dart';
import 'package:example/hive/hive_registrar.hive.dart';
import 'package:hive_ce/hive.dart';

part 'main.g.dart';
2 changes: 0 additions & 2 deletions hive_generator/build.stub.yaml

This file was deleted.


Unchanged files with check annotations Beta

/// Annotation to generate TypeAdapters for the given [specs]
class GenerateAdapters {
/// Constructor
const GenerateAdapters(this.specs, {this.firstTypeId = 0});

Check warning on line 6 in hive/lib/src/annotations/generate_adapters.dart

Codecov / codecov/patch

hive/lib/src/annotations/generate_adapters.dart#L6

Added line #L6 was not covered by tests
/// The classes to generate TypeAdapters for
final List<AdapterSpec> specs;
/// Configuration that specifies the generation of a TypeAdapter
class AdapterSpec<T> {
/// Constructor
const AdapterSpec();

Check warning on line 18 in hive/lib/src/annotations/generate_adapters.dart

Codecov / codecov/patch

hive/lib/src/annotations/generate_adapters.dart#L18

Added line #L18 was not covered by tests
}