Ignore *.g.part

This commit is contained in:
Tobe O 2018-08-24 09:24:45 -04:00
parent 453f0f9d0e
commit 3f55473164
5 changed files with 35 additions and 1 deletions

View file

@ -54,3 +54,4 @@ com_crashlytics_export_strings.xml
crashlytics.properties crashlytics.properties
crashlytics-build.properties crashlytics-build.properties
fabric.properties fabric.properties
*.g.part

View file

@ -0,0 +1,10 @@
builders:
angel_orm:
import: "package:angel_orm_generator/angel_orm_generator.dart"
builder_factories:
- ormBuilder
auto_apply: root_package
build_to: source
build_extensions:
.dart:
- ".orm.g.dart"

View file

@ -0,0 +1,3 @@
export 'src/orm_build_context.dart';
export 'src/orm_generator.dart';
export 'src/readers.dart';

View file

@ -0,0 +1,20 @@
import 'package:analyzer/dart/element/element.dart';
import 'package:angel_orm/angel_orm.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
Builder ormBuilder(_) {
return new LibraryBuilder(new OrmGenerator(),
generatedExtension: '.orm.g.dart');
}
class OrmGenerator extends GeneratorForAnnotation<ORM> {
@override
generateForAnnotatedElement(
Element element, ConstantReader annotation, BuildStep buildStep) {
if (element is ClassElement) {
} else {
throw 'The @Orm() annotation can only be applied to classes.';
}
}
}

View file

@ -9,7 +9,7 @@ part 'order.g.dart';
@orm @orm
@serializable @serializable
class _Order extends Model { class _Order extends Model {
@Join(Customer, 'id') @CanJoin(Customer, 'id')
int customerId; int customerId;
int employeeId; int employeeId;
DateTime orderDate; DateTime orderDate;