File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -22,14 +22,32 @@ includes generated files should add "protobuf" to its pubspec.yaml file.
2222How to build and use
2323--------------------
2424
25- Add ` protoc_plugin: any ` to your dependencies (this way the pub version
26- resolution will match up with your version of ` protobuf ` ).
25+ * Note:* currently the workflow is POSIX-oriented.
2726
28- Run ` pub get ` .
27+ To build standalone ` protoc ` plugin:
28+ - run ` pub install ` to install all dependencies
29+ - Now you can use the plugin either by adding the ` bin ` directory to your ` PATH ` ,
30+ or passing it directly with ` protoc ` 's ` --plugin ` option.
2931
30- Now you can compile your proto files like this:
32+ Please, remember that the plugin is pure Dart script and requires the presence
33+ of ` dart ` executable in your ` PATH ` .
34+
35+ When both the ` dart ` executable and ` bin/protoc-gen-dart ` are in the
36+ ` PATH ` the protocol buffer compiler can be invoked to generate like this:
37+
38+ $ protoc --dart_out=. test.proto
39+
40+ ### Optionally using ` pub global `
41+
42+ $ pub global activate protoc_plugin
43+
44+ And then add ` .pub-cache/bin ` in your home dir to your ` PATH ` if you haven't already.
45+
46+ This will activate the latest published version of the plugin. If you wish to use a
47+ local working copy, use
48+
49+ $ pub global activate -s path <path/to/your/dart-protoc-plugin>
3150
32- $ protoc --dart_out=lib/ protos/test.proto --plugin "pub run protoc_plugin"
3351
3452### Options to control the generated Dart code
3553
You can’t perform that action at this time.
0 commit comments