diff --git a/examples/drift/.gitignore b/examples/drift/.gitignore index b94efff6..adce9480 100644 --- a/examples/drift/.gitignore +++ b/examples/drift/.gitignore @@ -11,3 +11,4 @@ pubspec.lock # Example !*.g.dart +!*.auto_mappr.dart diff --git a/examples/drift/lib/mappr.g.dart b/examples/drift/lib/mappr.auto_mappr.dart similarity index 99% rename from examples/drift/lib/mappr.g.dart rename to examples/drift/lib/mappr.auto_mappr.dart index 717d0c4c..38d1d478 100644 --- a/examples/drift/lib/mappr.g.dart +++ b/examples/drift/lib/mappr.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'mappr.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'mappr.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_drift/mappr.dart} /// Available mappings: /// - `Todo` → `TodoItem`. diff --git a/examples/drift/lib/mappr.dart b/examples/drift/lib/mappr.dart index a996efc6..971c9813 100644 --- a/examples/drift/lib/mappr.dart +++ b/examples/drift/lib/mappr.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:examples_drift/db.dart'; -part 'mappr.g.dart'; +import 'mappr.auto_mappr.dart'; class TodoItem { final int id; diff --git a/examples/example/.gitignore b/examples/example/.gitignore index b94efff6..adce9480 100644 --- a/examples/example/.gitignore +++ b/examples/example/.gitignore @@ -11,3 +11,4 @@ pubspec.lock # Example !*.g.dart +!*.auto_mappr.dart diff --git a/examples/example/lib/enum.g.dart b/examples/example/lib/enum.auto_mappr.dart similarity index 99% rename from examples/example/lib/enum.g.dart rename to examples/example/lib/enum.auto_mappr.dart index 7e05cc9d..67f7cba6 100644 --- a/examples/example/lib/enum.g.dart +++ b/examples/example/lib/enum.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'enum.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'enum.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_example/enum.dart} /// Available mappings: /// - `UserType` → `PersonType`. diff --git a/examples/example/lib/enum.dart b/examples/example/lib/enum.dart index 670a1438..ee44c3cb 100644 --- a/examples/example/lib/enum.dart +++ b/examples/example/lib/enum.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'enum.g.dart'; +import 'package:examples_example/enum.auto_mappr.dart'; enum UserType { student, admin, parent } diff --git a/examples/example/lib/equatable.g.dart b/examples/example/lib/equatable.auto_mappr.dart similarity index 99% rename from examples/example/lib/equatable.g.dart rename to examples/example/lib/equatable.auto_mappr.dart index 3ac31a03..c65f85af 100644 --- a/examples/example/lib/equatable.g.dart +++ b/examples/example/lib/equatable.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'equatable.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'equatable.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_example/equatable.dart} /// Available mappings: /// - `UserDto` → `User`. diff --git a/examples/example/lib/equatable.dart b/examples/example/lib/equatable.dart index 29fee030..ac72afd4 100644 --- a/examples/example/lib/equatable.dart +++ b/examples/example/lib/equatable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'equatable.g.dart'; +import 'package:examples_example/equatable.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/examples/example/lib/nested.g.dart b/examples/example/lib/nested.auto_mappr.dart similarity index 99% rename from examples/example/lib/nested.g.dart rename to examples/example/lib/nested.auto_mappr.dart index cace55e7..738966fa 100644 --- a/examples/example/lib/nested.g.dart +++ b/examples/example/lib/nested.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'nested.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'nested.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_example/nested.dart} /// Available mappings: /// - `UserDto` → `User`. diff --git a/examples/example/lib/nested.dart b/examples/example/lib/nested.dart index 68a83b79..cbd79836 100644 --- a/examples/example/lib/nested.dart +++ b/examples/example/lib/nested.dart @@ -3,7 +3,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'nested.g.dart'; +import 'package:examples_example/nested.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/examples/example/lib/nullable.g.dart b/examples/example/lib/nullable.auto_mappr.dart similarity index 99% rename from examples/example/lib/nullable.g.dart rename to examples/example/lib/nullable.auto_mappr.dart index ed59201b..abe9da92 100644 --- a/examples/example/lib/nullable.g.dart +++ b/examples/example/lib/nullable.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'nullable.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'nullable.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_example/nullable.dart} /// Available mappings: /// - `UserDto` → `User` -- With default value. diff --git a/examples/example/lib/nullable.dart b/examples/example/lib/nullable.dart index 42ee90e5..04eb4fc7 100644 --- a/examples/example/lib/nullable.dart +++ b/examples/example/lib/nullable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'nullable.g.dart'; +import 'package:examples_example/nullable.auto_mappr.dart'; @AutoMappr([ MapType( diff --git a/examples/example/lib/rename.g.dart b/examples/example/lib/rename.auto_mappr.dart similarity index 99% rename from examples/example/lib/rename.g.dart rename to examples/example/lib/rename.auto_mappr.dart index 2a8a4626..b45a9dc7 100644 --- a/examples/example/lib/rename.g.dart +++ b/examples/example/lib/rename.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'rename.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'rename.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_example/rename.dart} /// Available mappings: /// - `UserDto` → `User`. diff --git a/examples/example/lib/rename.dart b/examples/example/lib/rename.dart index 9def8c16..59b1bf8c 100644 --- a/examples/example/lib/rename.dart +++ b/examples/example/lib/rename.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'rename.g.dart'; +import 'package:examples_example/rename.auto_mappr.dart'; @AutoMappr([ MapType( diff --git a/examples/freezed/.gitignore b/examples/freezed/.gitignore index b94efff6..adce9480 100644 --- a/examples/freezed/.gitignore +++ b/examples/freezed/.gitignore @@ -11,3 +11,4 @@ pubspec.lock # Example !*.g.dart +!*.auto_mappr.dart diff --git a/examples/freezed/lib/freezed_example.g.dart b/examples/freezed/lib/freezed_example.auto_mappr.dart similarity index 99% rename from examples/freezed/lib/freezed_example.g.dart rename to examples/freezed/lib/freezed_example.auto_mappr.dart index c7964b8e..e42f9032 100644 --- a/examples/freezed/lib/freezed_example.g.dart +++ b/examples/freezed/lib/freezed_example.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'freezed_example.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'freezed_example.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_freezed/freezed_example.dart} /// Available mappings: /// - `UserInfo` → `UserInfoCompanion`. diff --git a/examples/freezed/lib/freezed_example.dart b/examples/freezed/lib/freezed_example.dart index 9861f228..86270d48 100644 --- a/examples/freezed/lib/freezed_example.dart +++ b/examples/freezed/lib/freezed_example.dart @@ -1,8 +1,8 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; +import 'package:examples_freezed/freezed_example.auto_mappr.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'freezed_example.freezed.dart'; -part 'freezed_example.g.dart'; @freezed class UserInfoUnion with _$UserInfoUnion { diff --git a/examples/injectable/.gitignore b/examples/injectable/.gitignore index b94efff6..adce9480 100644 --- a/examples/injectable/.gitignore +++ b/examples/injectable/.gitignore @@ -11,3 +11,4 @@ pubspec.lock # Example !*.g.dart +!*.auto_mappr.dart diff --git a/examples/injectable/lib/mappr.g.dart b/examples/injectable/lib/mappr.auto_mappr.dart similarity index 99% rename from examples/injectable/lib/mappr.g.dart rename to examples/injectable/lib/mappr.auto_mappr.dart index bb04a465..05023986 100644 --- a/examples/injectable/lib/mappr.g.dart +++ b/examples/injectable/lib/mappr.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'mappr.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'mappr.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_injectable/mappr.dart} /// Available mappings: /// - `UserDto` → `User`. diff --git a/examples/injectable/lib/mappr.dart b/examples/injectable/lib/mappr.dart index 696257ba..44acf6a1 100644 --- a/examples/injectable/lib/mappr.dart +++ b/examples/injectable/lib/mappr.dart @@ -1,8 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; +import 'package:examples_injectable/mappr.auto_mappr.dart'; import 'package:injectable/injectable.dart'; -part 'mappr.g.dart'; - class User { final int id; final String name; diff --git a/examples/json_serializable/.gitignore b/examples/json_serializable/.gitignore index b94efff6..adce9480 100644 --- a/examples/json_serializable/.gitignore +++ b/examples/json_serializable/.gitignore @@ -11,3 +11,4 @@ pubspec.lock # Example !*.g.dart +!*.auto_mappr.dart diff --git a/examples/json_serializable/lib/serializable.g.dart b/examples/json_serializable/lib/serializable.auto_mappr.dart similarity index 91% rename from examples/json_serializable/lib/serializable.g.dart rename to examples/json_serializable/lib/serializable.auto_mappr.dart index 3a92c1ba..5425f115 100644 --- a/examples/json_serializable/lib/serializable.g.dart +++ b/examples/json_serializable/lib/serializable.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'serializable.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'serializable.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template package:examples_json_serializable/serializable.dart} /// Available mappings: /// - `UserDto` → `User`. @@ -241,27 +241,3 @@ class $Mappr implements AutoMapprInterface { return ValueHolder(model.json); } } - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -UserDto _$UserDtoFromJson(Map json) => UserDto( - firstName: json['firstName'] as String, - lastName: json['lastName'] as String, - ); - -Map _$UserDtoToJson(UserDto instance) => { - 'firstName': instance.firstName, - 'lastName': instance.lastName, - }; - -ValueHolderDto _$ValueHolderDtoFromJson(Map json) => - ValueHolderDto( - json['json'] as Map, - ); - -Map _$ValueHolderDtoToJson(ValueHolderDto instance) => - { - 'json': instance.json, - }; diff --git a/examples/json_serializable/lib/serializable.dart b/examples/json_serializable/lib/serializable.dart index ac32698a..2dee434b 100644 --- a/examples/json_serializable/lib/serializable.dart +++ b/examples/json_serializable/lib/serializable.dart @@ -1,8 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; +import 'package:examples_json_serializable/serializable.auto_mappr.dart'; import 'package:json_annotation/json_annotation.dart'; -part 'serializable.g.dart'; - @AutoMappr([ MapType(), MapType(), diff --git a/examples/json_serializable/test/fixture/json_serializable.g.dart b/examples/json_serializable/test/fixture/json_serializable.auto_mappr.dart similarity index 91% rename from examples/json_serializable/test/fixture/json_serializable.g.dart rename to examples/json_serializable/test/fixture/json_serializable.auto_mappr.dart index 4293c37b..74c78092 100644 --- a/examples/json_serializable/test/fixture/json_serializable.g.dart +++ b/examples/json_serializable/test/fixture/json_serializable.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'json_serializable.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'json_serializable.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template asset:examples_json_serializable/test/fixture/json_serializable.dart} /// Available mappings: /// - `UserDto` → `User`. @@ -241,27 +241,3 @@ class $Mappr implements AutoMapprInterface { return ValueHolder(model.json); } } - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -UserDto _$UserDtoFromJson(Map json) => UserDto( - firstName: json['firstName'] as String, - lastName: json['lastName'] as String, - ); - -Map _$UserDtoToJson(UserDto instance) => { - 'firstName': instance.firstName, - 'lastName': instance.lastName, - }; - -ValueHolderDto _$ValueHolderDtoFromJson(Map json) => - ValueHolderDto( - json['json'] as Map, - ); - -Map _$ValueHolderDtoToJson(ValueHolderDto instance) => - { - 'json': instance.json, - }; diff --git a/examples/json_serializable/test/fixture/json_serializable.dart b/examples/json_serializable/test/fixture/json_serializable.dart index 317e4ceb..6c9fb526 100644 --- a/examples/json_serializable/test/fixture/json_serializable.dart +++ b/examples/json_serializable/test/fixture/json_serializable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:json_annotation/json_annotation.dart'; -part 'json_serializable.g.dart'; +import 'json_serializable.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/.gitignore b/packages/auto_mappr/.gitignore index c6e36089..5f71119f 100644 --- a/packages/auto_mappr/.gitignore +++ b/packages/auto_mappr/.gitignore @@ -1,4 +1,5 @@ *.g.dart +*.auto_mappr.dart # Files and directories created by pub. .dart_tool/ diff --git a/packages/auto_mappr/CHANGELOG.md b/packages/auto_mappr/CHANGELOG.md index 87f9aa4f..59bd60fc 100644 --- a/packages/auto_mappr/CHANGELOG.md +++ b/packages/auto_mappr/CHANGELOG.md @@ -3,6 +3,9 @@ ## Unreleased - Add a `reverse` option on `MapType`, which includes the reverse mapping. [#115](https://github.com/netglade/auto_mappr/pull/115) +- Allow use modules using `includes` on `@AutoMappr`. Previous `modules` is now `delegates`. +- Remove shared AutoMappr builder that used PartBuilder, now `.auto_mappr.dart` is generated using LibraryBuilder. + ## 1.7.0 - Adhere to netglade_analysis. [#94](https://github.com/netglade/auto_mappr/pull/94) - Update analyzer and mocktail packages. [#111](https://github.com/netglade/auto_mappr/pull/111) diff --git a/packages/auto_mappr/README.md b/packages/auto_mappr/README.md index 5a0586eb..90454965 100644 --- a/packages/auto_mappr/README.md +++ b/packages/auto_mappr/README.md @@ -111,7 +111,7 @@ Then use `MapType()` for each mapping. ```dart import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'my_file.g.dart'; +import 'my_file.auto_mappr.dart'; @AutoMappr([ MapType(), @@ -126,7 +126,7 @@ See [features](#-features) for a complete list. ```dart import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'my_file.g.dart'; +import 'my_file.auto_mappr.dart'; @AutoMappr([ MapType( @@ -666,8 +666,8 @@ Equatable and other packages with similar conditions implicitly works. ### Works with `json_serializable` -AutoMappr uses a `SharedPartBuilder`. -That means it can share the `.g.dart` file with packages like JSON Serializable +AutoMappr uses a `LibraryBuilder` with `.auto_mappr.dart` file output. +That means it does not interfere with shared `.g.dart` file with packages like JSON Serializable to generate other code to the generated super class. ### Works with generated source and target classes @@ -685,10 +685,8 @@ Check the [customizing the build](#-customizing-the-build) chapter to learn more ## ⚙ Customizing the build -By default, AutoMappr uses the `auto_mappr:auto_mappr` builder -that works with `SharedPartBuilder`, which generates combined `.g.dart` files. -If you need to use `PartBuilder` to generate not-shared `.auto_mappr.dart` part files, -you can use the `auto_mappr:not_shared` builder. +By default, AutoMappr uses the `auto_mappr:auto_mappr` builder that works with `LibraryBuilder`, +which generates `.auto_mappr.dart` file. Modify your `build.yaml` file: @@ -700,19 +698,16 @@ targets: builders: # Or disable specific ones. auto_mappr: - enabled: false - # And enable the not_shared builder. - auto_mappr:not_shared: enabled: true ``` ### Builder options -- ignoreNullableSourceField - Force bang operator on non-nullable target's field if source's field is nullable + +- `ignoreNullableSourceField` - Force bang operator on non-nullable target's field if source's field is nullable ### Default dependencies -By default both `auto_mappr` builders has defined required inputs for freezed -and drift classes. +By default the `auto_mappr` builder has defined required inputs for freezed and drift classes. ```yaml required_inputs: [".freezed.dart", ".drift.dart"] @@ -729,25 +724,6 @@ which you can add a input dependency to. Specify the `required_inputs` dependency on your local AutoMappr builder and disable the builders provided by AutoMappr. -Shared builder: - -```yaml -targets: - $default: - auto_apply_builders: true - builders: - # Enable their generators according to their documentation. - drift_dev:not_shared: - enabled: true - drift_dev:preparing_builder: - enabled: true - # Disable Drift's shared builder - drift_dev:drift_dev: - enabled: false -``` - -Not shared builder: - ```yaml targets: $default: @@ -763,9 +739,6 @@ targets: enabled: false auto_mappr: - enabled: false - # Enable the not_shared builder. - auto_mappr:not_shared: enabled: true ``` diff --git a/packages/auto_mappr/build.yaml b/packages/auto_mappr/build.yaml index 905672fe..2fe76f57 100644 --- a/packages/auto_mappr/build.yaml +++ b/packages/auto_mappr/build.yaml @@ -13,16 +13,7 @@ builders: auto_mappr: import: "package:auto_mappr/auto_mappr.dart" builder_factories: ["autoMapprBuilder"] - build_extensions: { ".dart": [".auto_mappr.g.part"] } - auto_apply: dependents - build_to: cache - applies_builders: ["source_gen:combining_builder"] - required_inputs: [".freezed.dart", ".drift.dart"] - - not_shared: - import: "package:auto_mappr/auto_mappr.dart" - builder_factories: ["autoMapprBuilderNotShared"] build_extensions: { ".dart": [".auto_mappr.dart"] } - auto_apply: none + auto_apply: dependents build_to: source required_inputs: [".freezed.dart", ".drift.dart"] diff --git a/packages/auto_mappr/example/.gitignore b/packages/auto_mappr/example/.gitignore index 641b8adc..38c84cf9 100644 --- a/packages/auto_mappr/example/.gitignore +++ b/packages/auto_mappr/example/.gitignore @@ -1,2 +1,3 @@ # Example !*.g.dart +!*.auto_mappr.dart diff --git a/packages/auto_mappr/example/lib/mappr.g.dart b/packages/auto_mappr/example/lib/mappr.auto_mappr.dart similarity index 99% rename from packages/auto_mappr/example/lib/mappr.g.dart rename to packages/auto_mappr/example/lib/mappr.auto_mappr.dart index c290fb31..ac03cda5 100644 --- a/packages/auto_mappr/example/lib/mappr.g.dart +++ b/packages/auto_mappr/example/lib/mappr.auto_mappr.dart @@ -1,7 +1,5 @@ // GENERATED CODE - DO NOT MODIFY BY HAND -part of 'mappr.dart'; - // ************************************************************************** // AutoMapprGenerator // ************************************************************************** @@ -12,6 +10,8 @@ part of 'mappr.dart'; // ignore_for_file: unnecessary_lambdas, unnecessary_parenthesis // ignore_for_file: unnecessary_raw_strings +import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; + /// {@template asset:auto_mappr/example/lib/mappr.dart} /// Available mappings: /// - `UserDto` → `User`. diff --git a/packages/auto_mappr/example/lib/mappr.dart b/packages/auto_mappr/example/lib/mappr.dart index 77eaeeb2..76449bc2 100644 --- a/packages/auto_mappr/example/lib/mappr.dart +++ b/packages/auto_mappr/example/lib/mappr.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'mappr.g.dart'; +import 'mappr.auto_mappr.dart'; @AutoMappr([ MapType( diff --git a/packages/auto_mappr/lib/auto_mappr.dart b/packages/auto_mappr/lib/auto_mappr.dart index 48fc4da3..f6458534 100644 --- a/packages/auto_mappr/lib/auto_mappr.dart +++ b/packages/auto_mappr/lib/auto_mappr.dart @@ -5,12 +5,9 @@ import 'package:build/build.dart'; import 'package:source_gen/source_gen.dart'; /// Main Builder for the `AutoMappr` Annotation. -Builder autoMapprBuilder(BuilderOptions options) => SharedPartBuilder( - [AutoMapprGenerator(builderOptions: options)], - 'auto_mappr', - ); - -Builder autoMapprBuilderNotShared(BuilderOptions options) => PartBuilder( - [AutoMapprGenerator(builderOptions: options)], - '.auto_mappr.dart', +Builder autoMapprBuilder(BuilderOptions options) => LibraryBuilder( + AutoMapprGenerator(builderOptions: options), + generatedExtension: '.auto_mappr.dart', + allowSyntaxErrors: true, + options: options, ); diff --git a/packages/auto_mappr/lib/src/builder/auto_mappr_builder.dart b/packages/auto_mappr/lib/src/builder/auto_mappr_builder.dart index 3f076c92..ae786cea 100644 --- a/packages/auto_mappr/lib/src/builder/auto_mappr_builder.dart +++ b/packages/auto_mappr/lib/src/builder/auto_mappr_builder.dart @@ -32,13 +32,18 @@ class AutoMapprBuilder { }); Library build() { + // TODO(modules): first process class and then generate library and its imports + return Library( (b) => b ..ignoreForFile = ListBuilder(fileIgnores) + ..directives = ListBuilder([ + Directive.import('package:auto_mappr_annotation/auto_mappr_annotation.dart'), + ]) ..body.addAll( [ Class( - (b) => b + (cb) => cb ..name = '\$${mapperClassElement.displayName}' ..implements = ListBuilder([refer('AutoMapprInterface')]) ..methods.addAll(_buildMethods()) diff --git a/packages/auto_mappr/test/integration/error_fixture/enum_mapping_not_enum.dart b/packages/auto_mappr/test/integration/error_fixture/enum_mapping_not_enum.dart index d797631e..7bbc575d 100644 --- a/packages/auto_mappr/test/integration/error_fixture/enum_mapping_not_enum.dart +++ b/packages/auto_mappr/test/integration/error_fixture/enum_mapping_not_enum.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'enum_mapping_not_enum.g.dart'; +import 'enum_mapping_not_enum.auto_mappr.dart'; enum Source { a, b } diff --git a/packages/auto_mappr/test/integration/error_fixture/enum_mapping_subset.dart b/packages/auto_mappr/test/integration/error_fixture/enum_mapping_subset.dart index 0491f219..ff222e7e 100644 --- a/packages/auto_mappr/test/integration/error_fixture/enum_mapping_subset.dart +++ b/packages/auto_mappr/test/integration/error_fixture/enum_mapping_subset.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'enum_mapping_subset.g.dart'; +import 'enum_mapping_subset.auto_mappr.dart'; enum Source { a, b } diff --git a/packages/auto_mappr/test/integration/fixture/complex_types.dart b/packages/auto_mappr/test/integration/fixture/complex_types.dart index 5a885dc9..45802458 100644 --- a/packages/auto_mappr/test/integration/fixture/complex_types.dart +++ b/packages/auto_mappr/test/integration/fixture/complex_types.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'complex_types.g.dart'; +import 'complex_types.auto_mappr.dart'; @AutoMappr( [ diff --git a/packages/auto_mappr/test/integration/fixture/constructor_parameters.dart b/packages/auto_mappr/test/integration/fixture/constructor_parameters.dart index 7098f990..d21eec25 100644 --- a/packages/auto_mappr/test/integration/fixture/constructor_parameters.dart +++ b/packages/auto_mappr/test/integration/fixture/constructor_parameters.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'constructor_parameters.g.dart'; +import 'constructor_parameters.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/convert_iterable.dart b/packages/auto_mappr/test/integration/fixture/convert_iterable.dart index ea5acefa..e415e811 100644 --- a/packages/auto_mappr/test/integration/fixture/convert_iterable.dart +++ b/packages/auto_mappr/test/integration/fixture/convert_iterable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'convert_iterable.g.dart'; +import 'convert_iterable.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/custom_mapping.dart b/packages/auto_mappr/test/integration/fixture/custom_mapping.dart index 21164069..5c5470e4 100644 --- a/packages/auto_mappr/test/integration/fixture/custom_mapping.dart +++ b/packages/auto_mappr/test/integration/fixture/custom_mapping.dart @@ -3,7 +3,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'custom_mapping.g.dart'; +import 'custom_mapping.auto_mappr.dart'; @AutoMappr([ // custom type diff --git a/packages/auto_mappr/test/integration/fixture/default_field.dart b/packages/auto_mappr/test/integration/fixture/default_field.dart index 9175bfb9..36871b23 100644 --- a/packages/auto_mappr/test/integration/fixture/default_field.dart +++ b/packages/auto_mappr/test/integration/fixture/default_field.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'default_field.g.dart'; +import 'default_field.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/default_target.dart b/packages/auto_mappr/test/integration/fixture/default_target.dart index 3ebdad5e..255570e2 100644 --- a/packages/auto_mappr/test/integration/fixture/default_target.dart +++ b/packages/auto_mappr/test/integration/fixture/default_target.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'default_target.g.dart'; +import 'default_target.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/delegates.dart b/packages/auto_mappr/test/integration/fixture/delegates.dart index b5f873ca..0be70b50 100644 --- a/packages/auto_mappr/test/integration/fixture/delegates.dart +++ b/packages/auto_mappr/test/integration/fixture/delegates.dart @@ -3,7 +3,7 @@ import 'package:equatable/equatable.dart'; import 'modules/module_alpha.dart'; -part 'delegates.g.dart'; +import 'delegates.auto_mappr.dart'; @AutoMappr([MapType()], delegates: [MapprAlpha()]) class MapprGroup extends $MapprGroup { diff --git a/packages/auto_mappr/test/integration/fixture/delegates/module_alpha.dart b/packages/auto_mappr/test/integration/fixture/delegates/module_alpha.dart index c9ca910e..1dd873a5 100644 --- a/packages/auto_mappr/test/integration/fixture/delegates/module_alpha.dart +++ b/packages/auto_mappr/test/integration/fixture/delegates/module_alpha.dart @@ -1,10 +1,9 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; +import 'module_alpha.auto_mappr.dart'; import 'module_beta.dart'; -part 'module_alpha.g.dart'; - @AutoMappr([MapType()], delegates: [MapprBeta()]) class MapprAlpha extends $MapprAlpha { const MapprAlpha(); diff --git a/packages/auto_mappr/test/integration/fixture/delegates/module_beta.dart b/packages/auto_mappr/test/integration/fixture/delegates/module_beta.dart index 17e1b0d1..1cd48ac3 100644 --- a/packages/auto_mappr/test/integration/fixture/delegates/module_beta.dart +++ b/packages/auto_mappr/test/integration/fixture/delegates/module_beta.dart @@ -1,10 +1,9 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; +import 'module_beta.auto_mappr.dart'; import 'module_gama.dart'; -part 'module_beta.g.dart'; - @AutoMappr([MapType()], delegates: [MapprGama()]) class MapprBeta extends $MapprBeta { const MapprBeta(); diff --git a/packages/auto_mappr/test/integration/fixture/delegates/module_gama.dart b/packages/auto_mappr/test/integration/fixture/delegates/module_gama.dart index fee4a6d6..e00e7f7a 100644 --- a/packages/auto_mappr/test/integration/fixture/delegates/module_gama.dart +++ b/packages/auto_mappr/test/integration/fixture/delegates/module_gama.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'module_gama.g.dart'; +import 'module_gama.auto_mappr.dart'; @AutoMappr([MapType()]) class MapprGama extends $MapprGama { diff --git a/packages/auto_mappr/test/integration/fixture/enum_mapping.dart b/packages/auto_mappr/test/integration/fixture/enum_mapping.dart index 74509e4d..456f4e25 100644 --- a/packages/auto_mappr/test/integration/fixture/enum_mapping.dart +++ b/packages/auto_mappr/test/integration/fixture/enum_mapping.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'enum_mapping.g.dart'; +import 'enum_mapping.auto_mappr.dart'; enum Person { employee, parent, student } diff --git a/packages/auto_mappr/test/integration/fixture/equatable.dart b/packages/auto_mappr/test/integration/fixture/equatable.dart index 662754b5..723f1c5f 100644 --- a/packages/auto_mappr/test/integration/fixture/equatable.dart +++ b/packages/auto_mappr/test/integration/fixture/equatable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'equatable.g.dart'; +import 'equatable.auto_mappr.dart'; @AutoMappr([MapType()]) class Mappr extends $Mappr { diff --git a/packages/auto_mappr/test/integration/fixture/forced_null_source_field.dart b/packages/auto_mappr/test/integration/fixture/forced_null_source_field.dart index 937d51bf..068b8f91 100644 --- a/packages/auto_mappr/test/integration/fixture/forced_null_source_field.dart +++ b/packages/auto_mappr/test/integration/fixture/forced_null_source_field.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'forced_null_source_field.g.dart'; +import 'forced_null_source_field.auto_mappr.dart'; @AutoMappr([ MapType( diff --git a/packages/auto_mappr/test/integration/fixture/generics.dart b/packages/auto_mappr/test/integration/fixture/generics.dart index 542e67b4..96bfa463 100644 --- a/packages/auto_mappr/test/integration/fixture/generics.dart +++ b/packages/auto_mappr/test/integration/fixture/generics.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'generics.g.dart'; +import 'generics.auto_mappr.dart'; @AutoMappr([ // simple diff --git a/packages/auto_mappr/test/integration/fixture/import_alias.dart b/packages/auto_mappr/test/integration/fixture/import_alias.dart index 4bb75de6..e95f2d09 100644 --- a/packages/auto_mappr/test/integration/fixture/import_alias.dart +++ b/packages/auto_mappr/test/integration/fixture/import_alias.dart @@ -5,7 +5,7 @@ import 'import_alias/import_alias_1.dart' as a1; import 'import_alias/import_alias_2.dart' as a2; import 'import_alias/import_alias_module.dart' as module; -part 'import_alias.g.dart'; +import 'import_alias.auto_mappr.dart'; @AutoMappr( [ diff --git a/packages/auto_mappr/test/integration/fixture/import_alias/import_alias_module.dart b/packages/auto_mappr/test/integration/fixture/import_alias/import_alias_module.dart index db1a6de6..8aaa412f 100644 --- a/packages/auto_mappr/test/integration/fixture/import_alias/import_alias_module.dart +++ b/packages/auto_mappr/test/integration/fixture/import_alias/import_alias_module.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'import_alias_module.g.dart'; +import 'import_alias_module.auto_mappr.dart'; @AutoMappr([MapType()]) class ImportAliasModule extends $ImportAliasModule { diff --git a/packages/auto_mappr/test/integration/fixture/includes.dart b/packages/auto_mappr/test/integration/fixture/includes.dart index 36162185..f81a497e 100644 --- a/packages/auto_mappr/test/integration/fixture/includes.dart +++ b/packages/auto_mappr/test/integration/fixture/includes.dart @@ -3,7 +3,7 @@ import 'package:equatable/equatable.dart'; import 'includes/module_alpha.dart' as alpha_feature; -part 'includes.g.dart'; +import 'includes.auto_mappr.dart'; @AutoMappr([MapType()], includes: [alpha_feature.MapprAlpha()]) class MapprGroup extends $MapprGroup { diff --git a/packages/auto_mappr/test/integration/fixture/includes/module_alpha.dart b/packages/auto_mappr/test/integration/fixture/includes/module_alpha.dart index ec313d6e..d4390764 100644 --- a/packages/auto_mappr/test/integration/fixture/includes/module_alpha.dart +++ b/packages/auto_mappr/test/integration/fixture/includes/module_alpha.dart @@ -1,10 +1,9 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; +import 'module_alpha.auto_mappr.dart'; import 'module_beta.dart'; -part 'module_alpha.g.dart'; - @AutoMappr([MapType()], includes: [MapprBeta()]) class MapprAlpha extends $MapprAlpha { const MapprAlpha(); diff --git a/packages/auto_mappr/test/integration/fixture/includes/module_beta.dart b/packages/auto_mappr/test/integration/fixture/includes/module_beta.dart index 78bfc57d..1f00211f 100644 --- a/packages/auto_mappr/test/integration/fixture/includes/module_beta.dart +++ b/packages/auto_mappr/test/integration/fixture/includes/module_beta.dart @@ -1,10 +1,9 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; +import 'module_beta.auto_mappr.dart'; import 'module_gama.dart'; -part 'module_beta.g.dart'; - @AutoMappr([MapType()], includes: [MapprGama()]) class MapprBeta extends $MapprBeta { const MapprBeta(); diff --git a/packages/auto_mappr/test/integration/fixture/includes/module_gama.dart b/packages/auto_mappr/test/integration/fixture/includes/module_gama.dart index fee4a6d6..e00e7f7a 100644 --- a/packages/auto_mappr/test/integration/fixture/includes/module_gama.dart +++ b/packages/auto_mappr/test/integration/fixture/includes/module_gama.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'module_gama.g.dart'; +import 'module_gama.auto_mappr.dart'; @AutoMappr([MapType()]) class MapprGama extends $MapprGama { diff --git a/packages/auto_mappr/test/integration/fixture/iterable.dart b/packages/auto_mappr/test/integration/fixture/iterable.dart index aa3844c0..b2f9c82b 100644 --- a/packages/auto_mappr/test/integration/fixture/iterable.dart +++ b/packages/auto_mappr/test/integration/fixture/iterable.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'iterable.g.dart'; +import 'iterable.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/list.dart b/packages/auto_mappr/test/integration/fixture/list.dart index 4a99430d..1c592926 100644 --- a/packages/auto_mappr/test/integration/fixture/list.dart +++ b/packages/auto_mappr/test/integration/fixture/list.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'list.g.dart'; +import 'list.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/map.dart b/packages/auto_mappr/test/integration/fixture/map.dart index 541ba39b..736855c2 100644 --- a/packages/auto_mappr/test/integration/fixture/map.dart +++ b/packages/auto_mappr/test/integration/fixture/map.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'map.g.dart'; +import 'map.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/mapping_from_source.dart b/packages/auto_mappr/test/integration/fixture/mapping_from_source.dart index 921cfe83..9c6edfbf 100644 --- a/packages/auto_mappr/test/integration/fixture/mapping_from_source.dart +++ b/packages/auto_mappr/test/integration/fixture/mapping_from_source.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'mapping_from_source.g.dart'; +import 'mapping_from_source.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/mapping_to_target.dart b/packages/auto_mappr/test/integration/fixture/mapping_to_target.dart index 91d56590..79e92a29 100644 --- a/packages/auto_mappr/test/integration/fixture/mapping_to_target.dart +++ b/packages/auto_mappr/test/integration/fixture/mapping_to_target.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'mapping_to_target.g.dart'; +import 'mapping_to_target.auto_mappr.dart'; @AutoMappr([MapType()]) class Mappr extends $Mappr { diff --git a/packages/auto_mappr/test/integration/fixture/multiple_annotations.dart b/packages/auto_mappr/test/integration/fixture/multiple_annotations.dart index 0c397738..fa11e821 100644 --- a/packages/auto_mappr/test/integration/fixture/multiple_annotations.dart +++ b/packages/auto_mappr/test/integration/fixture/multiple_annotations.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'multiple_annotations.g.dart'; +import 'multiple_annotations.auto_mappr.dart'; class AnnotationA { const AnnotationA(); diff --git a/packages/auto_mappr/test/integration/fixture/primitive_types.dart b/packages/auto_mappr/test/integration/fixture/primitive_types.dart index 73b320f1..1a92c855 100644 --- a/packages/auto_mappr/test/integration/fixture/primitive_types.dart +++ b/packages/auto_mappr/test/integration/fixture/primitive_types.dart @@ -2,7 +2,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'primitive_types.g.dart'; +import 'primitive_types.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/regression/uint8_issue_77.dart b/packages/auto_mappr/test/integration/fixture/regression/uint8_issue_77.dart index 3de6ca91..cebc91ad 100644 --- a/packages/auto_mappr/test/integration/fixture/regression/uint8_issue_77.dart +++ b/packages/auto_mappr/test/integration/fixture/regression/uint8_issue_77.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'uint8_issue_77.g.dart'; +import 'uint8_issue_77.auto_mappr.dart'; class Source { final Uint8List int8List; diff --git a/packages/auto_mappr/test/integration/fixture/rename.dart b/packages/auto_mappr/test/integration/fixture/rename.dart index 90cfedcc..32bfa30d 100644 --- a/packages/auto_mappr/test/integration/fixture/rename.dart +++ b/packages/auto_mappr/test/integration/fixture/rename.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'rename.g.dart'; +import 'rename.auto_mappr.dart'; @AutoMappr([ // nested diff --git a/packages/auto_mappr/test/integration/fixture/reverse.dart b/packages/auto_mappr/test/integration/fixture/reverse.dart index c79569b0..58acf2d5 100644 --- a/packages/auto_mappr/test/integration/fixture/reverse.dart +++ b/packages/auto_mappr/test/integration/fixture/reverse.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'reverse.g.dart'; +import 'reverse.auto_mappr.dart'; @AutoMappr([ MapType(reverse: true), diff --git a/packages/auto_mappr/test/integration/fixture/selecting_constructor.dart b/packages/auto_mappr/test/integration/fixture/selecting_constructor.dart index 2c2bb7fa..f3fbcff5 100644 --- a/packages/auto_mappr/test/integration/fixture/selecting_constructor.dart +++ b/packages/auto_mappr/test/integration/fixture/selecting_constructor.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'selecting_constructor.g.dart'; +import 'selecting_constructor.auto_mappr.dart'; @AutoMappr([ // empty diff --git a/packages/auto_mappr/test/integration/fixture/set.dart b/packages/auto_mappr/test/integration/fixture/set.dart index 1fb5e99b..2f40bee8 100644 --- a/packages/auto_mappr/test/integration/fixture/set.dart +++ b/packages/auto_mappr/test/integration/fixture/set.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'set.g.dart'; +import 'set.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/special_characters.dart b/packages/auto_mappr/test/integration/fixture/special_characters.dart index 24bb41d1..8a7b6663 100644 --- a/packages/auto_mappr/test/integration/fixture/special_characters.dart +++ b/packages/auto_mappr/test/integration/fixture/special_characters.dart @@ -3,7 +3,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'special_characters.g.dart'; +import 'special_characters.auto_mappr.dart'; @AutoMappr([ // in class diff --git a/packages/auto_mappr/test/integration/fixture/super_class.dart b/packages/auto_mappr/test/integration/fixture/super_class.dart index 6f0a1071..403c369c 100644 --- a/packages/auto_mappr/test/integration/fixture/super_class.dart +++ b/packages/auto_mappr/test/integration/fixture/super_class.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'super_class.g.dart'; +import 'super_class.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/try_convert.dart b/packages/auto_mappr/test/integration/fixture/try_convert.dart index 8339278b..54cf9e81 100644 --- a/packages/auto_mappr/test/integration/fixture/try_convert.dart +++ b/packages/auto_mappr/test/integration/fixture/try_convert.dart @@ -1,7 +1,7 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; import 'package:equatable/equatable.dart'; -part 'try_convert.g.dart'; +import 'try_convert.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr/test/integration/fixture/when_source_is_null.dart b/packages/auto_mappr/test/integration/fixture/when_source_is_null.dart index e13d284b..f9605c01 100644 --- a/packages/auto_mappr/test/integration/fixture/when_source_is_null.dart +++ b/packages/auto_mappr/test/integration/fixture/when_source_is_null.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'when_source_is_null.g.dart'; +import 'when_source_is_null.auto_mappr.dart'; class SourceValue { final String? name; diff --git a/packages/auto_mappr_annotation/README.md b/packages/auto_mappr_annotation/README.md index 889d2292..0d023843 100644 --- a/packages/auto_mappr_annotation/README.md +++ b/packages/auto_mappr_annotation/README.md @@ -21,7 +21,7 @@ Developed with 💚 by [netglade][netglade_link] ```dart import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -part 'main.g.dart'; +import 'main.auto_mappr.dart'; @AutoMappr([ MapType(), diff --git a/packages/auto_mappr_annotation/example/lib/main.dart b/packages/auto_mappr_annotation/example/lib/main.dart index d8d842d6..d6b539ce 100644 --- a/packages/auto_mappr_annotation/example/lib/main.dart +++ b/packages/auto_mappr_annotation/example/lib/main.dart @@ -1,6 +1,6 @@ import 'package:auto_mappr_annotation/auto_mappr_annotation.dart'; -// part 'main.g.dart'; +// part 'main.auto_mappr.dart'; @AutoMappr([ MapType(),