google/serialization.dart — pull request #9 by nicolasgarnier (2014-12-17 15:06:51+00:00)
Title: Makes setup of transformer based serialization more simple.

The goal of this PR is to simplify the setup of transformer based serialization while keeping it flexible and also make the Editor happy (no more importing of not-yet generated files). This includes the following changes:
- Generate one file containing all generated serialization rules
- Automatically replace the ...serialization.dart import with the generated Serialization rules file. It overrides the constructors so that all generated rules are automatically added.
- Generate rules for Classes with the @Serializable() annotation.
- Fixed bug where "part of" files where not imported properly (because we need to import the main library file).
- Allow to process classes of files that are in imported packages (couldn't do that with the $include: ["lib/stuff.dart", "lib/more_stuff.dart" ...] in the old transformer).

With these changes developers can just do:

import 'package:serialization/serialization.dart';
...
var serialization = new Serialization();

Person person = new Person();
...
var personJson = serialization.write(person);

And the pubspec.yaml declaration looks like this:

transformers:
- serialization :
useAnnotation: true
files:
- bin/stuff.dart
- lib/more_stuff.dart
- package:package_name/3rd_party_stuff.dart #for imported packages