b14da29f0a066d83f792d7802183c9fde0a860db
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / 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 and resolve any trailing spaces issues & build the .jar
26 ########################################################################################################
27
28 protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto
29
30 echo "Done generating Java source files."
31
32 find src/main/java -type f -name '*.java' -exec sed --in-place 's/[[:space:]]\+$//' {} \+