Skip to content

Commit b69c42e

Browse files
authored
Merge pull request #11 from ctlong/feat/protobuf-syntax
Feat: protobuf syntax
2 parents 3764ad3 + bf5c85d commit b69c42e

File tree

8 files changed

+421
-172
lines changed

8 files changed

+421
-172
lines changed

README.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,49 @@ Please see the following for detailed descriptions of each type:
2020

2121
## Generating code
2222

23-
Note: Due to [maps not being supported in protoc v2.X](https://github.com/google/protobuf/issues/799#issuecomment-138207911), the proto definitions in this repository require protoc v3.0.0 or higher.
23+
### Setup
24+
25+
Install protobuf.
26+
27+
*Note: Due to [maps not being supported in protoc v2.X](https://github.com/google/protobuf/issues/799#issuecomment-138207911), the proto definitions in this repository require protoc v3.0.0 or higher.*
28+
29+
On mac:
30+
```
31+
brew install protobuf
32+
```
2433

2534
### Go
2635

27-
Code generation for Go has moved to the [Sonde-Go](https://github.com/cloudfoundry/sonde-go) library.
36+
The [Sonde-Go](https://github.com/cloudfoundry/sonde-go) library can be used instead.
2837

29-
### Java
38+
Or, from your working directory, where `$DST_DIR` is the desired destination:
39+
```
40+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
41+
protoc --go_out=. dropsonde-protocol/events/*.proto
42+
mv github.com/cloudfoundry/sonde-go/events/*.pb.go $DST_DIR
43+
rm -rf github.com
44+
```
3045

31-
1. Build the go code first (see above) so that all the imports are available
46+
### Java
3247

33-
2. Generate the Java code (optionally providing a target path as a directory)
34-
```
35-
./generate-java.sh [TARGET_PATH]
36-
```
48+
From your working directory, where `$DST_DIR` is the desired destination:
49+
```
50+
protoc --java_out=. dropsonde-protocol/events/*.proto
51+
mv org/cloudfoundry/dropsonde/events/*.java $DST_DIR
52+
rm -rf org
53+
```
3754

3855
### Other languages
3956

4057
For C++ and Python, Google provides [tutorials](https://developers.google.com/protocol-buffers/docs/tutorials).
4158

42-
Please see [this list](https://github.com/google/protobuf/wiki/Third-Party-Add-ons#Programming_Languages) for working with protocol buffers in other languages.
59+
Please see [this list](https://github.com/protocolbuffers/protobuf/blob/master/docs/third_party.md) for working with protocol buffers in other languages.
4360

4461
### Message documentation
4562

46-
Each package's documentation is auto-generated with [protoc-gen-doc](https://github.com/estan/protoc-gen-doc). After installing the tool, run:
63+
Each package's documentation is auto-generated with [protoc-gen-doc](https://github.com/estan/protoc-gen-doc). After installing the tool, run the following from your working directory:
4764
```
48-
cd events
49-
protoc --doc_out=markdown,README.md:. *.proto
65+
protoc --doc_out=markdown,README.md:dropsonde-protocol/events dropsonde-protocol/events/*.proto
5066
```
5167

5268
## Communication protocols

0 commit comments

Comments
 (0)