Skip to content

Commit 56812f2

Browse files
Merge pull request #125 from icapps/feature/#123-show-files-are-generated
Feature/#123 show files are generated
2 parents 210342f + c426729 commit 56812f2

File tree

60 files changed

+124
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+124
-1
lines changed

example/lib/custom_model_directory/article/custom_base_directory_obj.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/article/no_custom_base_directory_obj.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/ogm.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/person/gender.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/person/person.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/profile/admin_profile_data.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/profile/user_profile_data.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/profile/user_profile_data_extended.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/project/project.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/lib/model/user/testing.dart

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/writer/enum_model_writer.dart

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:model_generator/model/model/enum_model.dart';
2+
import 'package:model_generator/writer/object_model_writer.dart';
23

34
class EnumModelWriter {
45
final EnumModel jsonModel;
@@ -7,6 +8,8 @@ class EnumModelWriter {
78

89
String write() {
910
final sb = StringBuffer()
11+
..writeln(ObjectModelWriter.autoGeneratedWarning)
12+
..writeln()
1013
..writeln("import 'package:json_annotation/json_annotation.dart';")
1114
..writeln();
1215

lib/writer/object_model_writer.dart

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import '../util/case_util.dart';
1111
import '../util/type_checker.dart';
1212

1313
class ObjectModelWriter {
14+
static const autoGeneratedWarning =
15+
'// GENERATED CODE - DO NOT MODIFY BY HAND';
1416
final PubspecConfig pubspecConfig;
1517
final ObjectModel jsonModel;
1618
final List<Field> extendsFields;
@@ -24,7 +26,9 @@ class ObjectModelWriter {
2426
);
2527

2628
String write() {
27-
final sb = StringBuffer();
29+
final sb = StringBuffer()
30+
..writeln(autoGeneratedWarning)
31+
..writeln();
2832
final imports = <String>{}
2933
..add("import 'package:json_annotation/json_annotation.dart';");
3034
for (final element

test/writer/enum_model_writer/custom-value-map-extension.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/enum_model_writer/custom-value-map.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/enum_model_writer/custom-value.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/enum_model_writer/no-fields.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/enum_model_writer/normal-description.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
///A good description of this enum

test/writer/enum_model_writer/normal.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/enum_model_writer/null-value.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
enum MyEnumModel {

test/writer/object_model_writer/array/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/converter/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/date_time_converter.dart';
35

test/writer/object_model_writer/custom-from-to/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/time.dart';
35

test/writer/object_model_writer/dart-import/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/custom_address.dart';
35

test/writer/object_model_writer/dart-package-import/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:shared/user/custom_address.dart';
35

test/writer/object_model_writer/default-field-required-null-disallowed/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/default-field-required/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/default-field/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/explicit-to-json-false-pubspec/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/explicit-to-json-false/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/extend-fields-twice/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/user.dart';
35

test/writer/object_model_writer/extend-fields-with-non-dart-type/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/custom_address.dart';
35
import 'package:model_generator_example/model/user/person/person.dart';

test/writer/object_model_writer/extend-fields/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/person.dart';
35

test/writer/object_model_writer/extra-imports-on-model/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'testing:package.dart';
35

test/writer/object_model_writer/extra-imports/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:flutter/foundation.dart';
24
import 'package:json_annotation/json_annotation.dart';
35

test/writer/object_model_writer/generate-for-generics-override-2/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/generate-for-generics-override/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/generate-for-generics/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/ignore/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/import_sorting/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:aaaaaa_application/model/user/a_model/a_model.dart';
24
import 'package:json_annotation/json_annotation.dart';
35

test/writer/object_model_writer/include-if-null/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/map-reference/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/person.dart';
35

test/writer/object_model_writer/map/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/non-final/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-equals-hashcode-empty/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-equals-hashcode-some-ignored/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-equals-hashcode/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-retrofit-compute/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-static-create/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-to-string/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal-with-description/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/normal/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/nullsafety/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/package-import/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:shared/user/custom_address/address.dart';
35

test/writer/object_model_writer/required/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/retrofit-compute-tearoff/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/sort/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24

35
part 'person.g.dart';

test/writer/object_model_writer/to-json-from-json-handler/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/address.dart';
35
import 'testing:handler.dart';

test/writer/object_model_writer/to-json-from-json/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/address.dart';
35

test/writer/object_model_writer/unknown-enum-value/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/user/person/gender.dart';
35

test/writer/object_model_writer/without-path/output.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// GENERATED CODE - DO NOT MODIFY BY HAND
2+
13
import 'package:json_annotation/json_annotation.dart';
24
import 'package:model_generator_example/model/address.dart';
35

0 commit comments

Comments
 (0)