diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-08-01 14:20:10 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-08-01 14:20:32 +0200 |
commit | 846f71127fdf498c69090157f748517c5eb22888 (patch) | |
tree | 4720c6684086b99ba52108c7ea8618e15bdff07e /compile_protobuf.sh | |
parent | 8ea927b076a9447ce401b9c65ed8d3c0e93b05c6 (diff) | |
download | sonarqube-846f71127fdf498c69090157f748517c5eb22888.tar.gz sonarqube-846f71127fdf498c69090157f748517c5eb22888.zip |
compile_protobuf.sh does not need local installation of protoc
Diffstat (limited to 'compile_protobuf.sh')
-rwxr-xr-x | compile_protobuf.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compile_protobuf.sh b/compile_protobuf.sh index 38429335487..e4bd4d96326 100755 --- a/compile_protobuf.sh +++ b/compile_protobuf.sh @@ -1,7 +1,12 @@ #!/bin/bash # Compiles all the Protocol Buffers files (*.proto) to Java source code. -# IMPORTANT - protobuf 2.6.1 must be installed. Other versions are not supported. +# Local installation of protobuf compiler is NOT needed. + +# Available versions listed at http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.os72%22%20AND%20a%3A%22protoc-jar%22 +PROTOBUF_VERSION="2.6.1.4" + +mvn org.apache.maven.plugins:maven-dependency-plugin::copy -Dartifact=com.github.os72:protoc-jar:$PROTOBUF_VERSION -DoutputDirectory=target # Usage: compile_protobuf <module> <type: main or test> function compile_protobuf { @@ -13,7 +18,7 @@ function compile_protobuf { echo "Compiling [$INPUT] to [$OUTPUT]..." rm -rf $OUTPUT mkdir -p $OUTPUT - protoc --proto_path=$INPUT --java_out=$OUTPUT $INPUT/*.proto + java -jar target/protoc-jar-$PROTOBUF_VERSION.jar --proto_path=$INPUT --java_out=$OUTPUT $INPUT/*.proto fi } |