Created sal-clustering-commons and moved
[controller.git] / opendaylight / md-sal / sal-clustering-commons / README-FIRST
1 Instructions on generating the protocol buffer Java source files
2
3 These instructions are developers who are planning to generate the protocolbuffer java source files.
4
5 1. We are using protocol buffer version 2.5.0 - you need to install the exact same version on your box.
6 The download link is https://code.google.com/p/protobuf/downloads/list. Download .tar/zip based on
7 your OS.
8
9 2. Once downloaded the tar/zip and extracted follow the README instructions to compile protoc on your
10 machine
11
12 3. Create your .proto (IDL) file in resources folder. Give appropriate package name so that the source
13    get generation in proper packages. For more information  check
14    https://developers.google.com/protocol-buffers/docs/javatutorial
15
16    For detailed information https://developers.google.com/protocol-buffers/docs/reference/java-generated
17
18 4. To generate the java source files execute in sal-protocolbuffer-encoding directory
19    just run.sh in sal-protocolbuffer-encoding or execute the following command
20
21  protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto
22
23 5. Run mvn clean install  & build the .jar
24
25 6. !!!WARNING!!! - never edit the generated sources files of protocol buffer
26
27 7. !!!IMPORTANT!!! if you are planning to add new .proto file  option java_package should begin with
28    org.opendaylight.controller.protobuff.messages to properly exclude from sonar.
29
30 8. !!!IMPORTANT!!! for any new .proto file added you need to create corresponding version-compatibility-serialized-data
31    serialized test file under test/resources and a test case for one message in your .proto file.
32    Please follow the instruction in readme.txt in that folder