Skip to content

Commit

Permalink
Merge pull request elastic#175 from Tom-Artale/build-java-only
Browse files Browse the repository at this point in the history
Added script to only generate messages in Java, for StorageOverseer
  • Loading branch information
Ben Aldrich committed May 20, 2014
2 parents 460bc34 + 6d03e35 commit cc33fd1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/buildProtoFilesJava.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -e
startDir=`pwd`
javaSrcDir="$startDir"/java/src/main/java
protoFileDir="$startDir"/protofiles
scriptsDir="$startDir"/scripts
thirdPartyDir="$startDir"/thirdParty
DIST=dist
DISTDIR="$thirdPartyDir"/$DIST
protoInstallDir="$DISTDIR"/protobuf/
protoc="$protoInstallDir"/bin/protoc
PROTOBUFFER_VERSION=2.5.0
GLOBAL_CPP_FLAGS="-fPIC"

if [ ! -f "$protoc" ]; then
sh "$scriptsDir"/compileThirdParty.sh
fi

export LD_LIBRARY_PATH="$protoInstallDir"/lib

mkdir -p "$javaSrcDir"
cd "$javaSrcDir"
"$protoc" -I="$protoFileDir" --java_out=. "$protoFileDir"/BaseConfMsg.proto
# the build below will generate java code with single methods > 64k, to fix this
# we would have to enable option optimize_for = CODE_SIZE
#"$protoc" -I="$protoFileDir" --java_out=. "$protoFileDir"/DpiMsgLRproto.proto
for file in `ls "$protoFileDir" | grep -v DpiMsgLRproto | grep -v Applications` ; do
"$protoc" -I="$protoFileDir" --java_out=. "$protoFileDir"/$file
done
cd "$startDir"

0 comments on commit cc33fd1

Please sign in to comment.