diff options
author | Daniel Lublin <daniel@lublin.se> | 2020-04-11 22:36:03 +0300 |
---|---|---|
committer | Daniel Lublin <daniel@lublin.se> | 2020-04-11 22:51:37 +0300 |
commit | a79f6d4f44495dcaa691dbee686ada6e43bdb1bd (patch) | |
tree | 0c375a8845af428a70ae841656c3bee5f9fabd15 | |
parent | e451061ccba59f8e1a329d4a42093260c75d5567 (diff) |
Add script to update and compile protobuf
-rwxr-xr-x | protobuf-update-and-compile.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/protobuf-update-and-compile.sh b/protobuf-update-and-compile.sh new file mode 100755 index 0000000..686e248 --- /dev/null +++ b/protobuf-update-and-compile.sh @@ -0,0 +1,32 @@ +#!/bin/sh +set -eu + +protoc=$(protoc --version) + +mumblerepo=../mumble +protof=src/Mumble.proto + +cwd=$(pwd) +cd "$mumblerepo" +describe=$(git describe --tags --dirty --always) +branch=$(git rev-parse --symbolic-full-name --abbrev-ref HEAD) +cd "$cwd" + +cat <<EOF >"$protof" +// This is $protof from the Mumble repository at $describe (branch $branch). +// Going to compile to java classes using protoc from ${protoc}. +// NOTE: java compile options added at the bottom of this file. +// +EOF + +cat >>"$protof" "$mumblerepo/$protof" + +cat <<EOF >>"$protof" +option java_package = "se.lublin.humla.protobuf"; +option java_outer_classname = "Mumble"; +option java_multiple_files = false; +EOF + +protoc --java_out=src/main/java "$protof" + +git diff --stat src/main/java/ "$protof" |