X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-protocolbuffer-encoding%2Frun.sh;h=f0907db6648e974298bb399f0956e719cd6e1552;hp=72e2c87ecba11018079e9d2c95c844e0bdbfd188;hb=17d82f582a6bc13c78be3b19954ff8c021180e93;hpb=e972dd79ada7a92f36bc033ebfb97e554ca1944d diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/run.sh b/opendaylight/md-sal/sal-protocolbuffer-encoding/run.sh index 72e2c87ecb..f0907db664 100755 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/run.sh +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/run.sh @@ -22,9 +22,20 @@ # or run command # protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto # -#5. Run mvn clean install and resolve any trailing spaces issues & build the .jar +#5. Run mvn clean install & build the .jar +# +#6 !!!WARNING!!!! never edit the source files generated +# +#7. !!!NOTE!!! if you are planning to add new .proto file option java_package should begin with +# org.opendaylight.controller.protobuff.messages to properly exclude from sonar. ######################################################################################################## protoc --proto_path=src/main/resources --java_out=src/main/java src/main/resources/*.proto -echo "Done generating Java source files." \ No newline at end of file +echo "Done generating Java source files." + +#to remove trailing spaces in the code files +find src/main/java -type f -name '*.java' -exec sed --in-place 's/[[:space:]]\+$//' {} \+ + +#to remove trailing spaces in the generated code on OSX +find src/main/java -type f -print0 |xargs -0 perl -pi -e 's/ +$//'