Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: README.md

Issue 923733002: Major refactor of the transformer, added an `InitializePlugin` class which allows you to hook direc… (Closed) Base URL: git@github.com:dart-lang/static-init.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: README.md
diff --git a/README.md b/README.md
index 99c8cec743ab83d62ac1629e3584cd4fb66a782f..db80da5551517f1ab0f6495d6fd0bf6bac534f8b 100644
--- a/README.md
+++ b/README.md
@@ -91,3 +91,17 @@ something like the following:
Now when people use the annotation, it just looks like `@initMethod` without any
parenthesis, and its a bit more efficient since there is a single instance. You
can also make your class private to force users into using the static instance.
+
+## Creating custom transformer plugins
+
+It is possible to create a custom plugin for the initialize transformer which
+allows you to have full control over what happens to your annotations at compile
+time. Implement `InitializePlugin` class and pass that in to the
+`InitializeTransformer` to make it take effect.
+
+You will need to be familiar with the `analyzer` package in order to write these
+plugins, but they can be extremely powerful. See the `DefaultInitializerPlugin`
+in `lib/build/initializer_plugin.dart` as a reference. Chances are you may want
+to extend that class in order to get a lot of the default functionality.
+
+TODO: Add some examples here.
Siggi Cherem (dart-lang) 2015/02/13 00:50:36 I think the pointer above is good, not sure if we
jakemac 2015/02/13 20:16:05 Done.

Powered by Google App Engine
This is Rietveld 408576698