You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

compile_protobuf.sh 972B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # Compiles all the Protocol Buffers files (*.proto) to Java source code.
  3. # Local installation of protobuf compiler is NOT needed.
  4. # Available versions listed at http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.os72%22%20AND%20a%3A%22protoc-jar%22
  5. PROTOBUF_VERSION="2.6.1.4"
  6. mvn org.apache.maven.plugins:maven-dependency-plugin::copy -Dartifact=com.github.os72:protoc-jar:$PROTOBUF_VERSION -DoutputDirectory=target
  7. # Usage: compile_protobuf <module> <type: main or test>
  8. function compile_protobuf {
  9. INPUT="$1/src/$2/protobuf"
  10. OUTPUT="$1/src/$2/gen-java"
  11. if [ -d $INPUT ]
  12. then
  13. echo "Compiling [$INPUT] to [$OUTPUT]..."
  14. rm -rf $OUTPUT
  15. mkdir -p $OUTPUT
  16. java -jar target/protoc-jar-$PROTOBUF_VERSION.jar --proto_path=$INPUT --java_out=$OUTPUT $INPUT/*.proto
  17. fi
  18. }
  19. compile_protobuf "sonar-batch-protocol" "main"
  20. compile_protobuf "sonar-core" "test"
  21. compile_protobuf "sonar-db" "main"
  22. compile_protobuf "sonar-ws" "main"