Part directive

This commit is contained in:
Tobe O 2018-07-15 00:45:01 -04:00
parent 4bf3308beb
commit 63df555639
3 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,6 @@
# 1.3.2
* Restore `part` directives in generated models.
# 1.3.1
* Add `deploy nginx` and `deploy systemd`.

View file

@ -72,6 +72,11 @@ class ModelCommand extends Command {
deps.add(const MakerDependency('angel_orm', '^1.0.0-alpha'));
}
modelLib.body.addAll([
new Code('part ${rc.snakeCase}.g.dart'),
new Code('part ${rc.snakeCase}.serializer.g.dart'),
]);
modelLib.body.add(new Class((modelClazz) {
modelClazz
..abstract = true
@ -79,7 +84,6 @@ class ModelCommand extends Command {
..extend = refer('Model');
if (needsSerialize) {
// TODO: Add parts
// modelLib.addDirective(new PartBuilder('${rc.snakeCase}.g.dart'));
modelClazz.annotations.add(refer('serializable'));
}

View file

@ -2,7 +2,7 @@ author: Tobe O <thosakwe@gmail.com>
description: Command-line tools for the Angel framework.
homepage: https://github.com/angel-dart/angel_cli
name: angel_cli
version: 1.3.1
version: 1.3.2
dependencies:
analyzer: ">=0.32.0"
args: ^1.0.0