Merge "Bug 1369: Use separate single threadpool for data operations on binding mountp...
[controller.git] / opendaylight / md-sal / sal-akka-raft / run.sh
1 #!/bin/bash
2
3 #####################################################################################################
4 #Instructions on generating the protocol buffer Java source files
5 #
6 #These instructions are developers who are planning to generate the protocolbuffer java source files.
7 #
8 #1. We are using protocol buffer version 2.5.0 - you need to install the exact same version on your box.
9 #The download link is https://code.google.com/p/protobuf/downloads/list. Download .tar/zip based on
10 #your OS.
11 #
12 #2. Once downloaded the tar/zip and extracted follow the README instructions to compile protoc on your
13 #machine
14 #
15 #3. Create your .proto (IDL) file in resources folder. Give appropriate package name so that the source
16 #   get generation in proper packages. For more information  check
17 #   https://developers.google.com/protocol-buffers/docs/javatutorial
18 #
19 #   For detailed information https://developers.google.com/protocol-buffers/docs/reference/java-generated
20 #
21 #4. To generate the java source files execute in sal-protocolbuffer-encoding execute ./run.sh i.e. this script
22 # or run command
23 #       protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto
24 #
25 #5. Run mvn clean install & build the .jar
26 #
27 #6  !!!WARNING!!!! never edit the source files generated
28 #
29 #7. !!!NOTE!!! if you are planning to add new .proto file  option java_package should begin with
30 #   org.opendaylight.controller.protobuff.messages to properly exclude from sonar.
31 ########################################################################################################
32
33 protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto
34
35 protoc --proto_path=src/main/resources --proto_path=src/test/resources --java_out=src/test/java src/test/resources/*.proto
36
37 echo "Done generating Java source files."
38
39 #to remove trailing spaces in the code files
40 find src/main/java -type f -name '*.java' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
41
42 find src/test/java -type f -name '*.java' -exec sed --in-place 's/[[:space:]]\+$//' {} \+