From 43faabe027477955bb49c3db8af94f0da33f2b7c Mon Sep 17 00:00:00 2001 From: Matan Rubin Date: Thu, 30 Nov 2017 17:00:13 +0200 Subject: [PATCH] protoc: add page for Google Protobuf (#1698) --- pages/common/protoc.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/common/protoc.md diff --git a/pages/common/protoc.md b/pages/common/protoc.md new file mode 100644 index 0000000000..441e08516f --- /dev/null +++ b/pages/common/protoc.md @@ -0,0 +1,15 @@ +# protoc + +> Parse Google Protobuf `.proto` files and generate output in the specified language. + +- Generate Python code from a `.proto` file: + +`protoc --python_out={{path/to/output_directory}} {{input_file.proto}}` + +- Generate Java code from a `.proto` file that imports other `.proto` files: + +`protoc --java_out={{path/to/output_directory}} --proto_path={{path/to/import_search_path}} {{input_file.proto}}` + +- Generate code for multiple languages: + +`protoc --csharp_out={{path/to/c#_output_directory}} --js_out={{path/to/js_output_directory}} {{input_file.proto}}`