diff --git a/Gemfile b/Gemfile index e13e6cff1..1198e742f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source 'https://rubygems.org' -gem 'ruby_protobuf', '0.4.11' +gem 'ruby-protocol-buffers' diff --git a/Gemfile.lock b/Gemfile.lock index 59d0d0823..c368bdb9d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,10 @@ GEM remote: https://rubygems.org/ specs: - ruby_protobuf (0.4.11) + ruby-protocol-buffers (1.2.2) PLATFORMS ruby DEPENDENCIES - ruby_protobuf (= 0.4.11) + ruby-protocol-buffers diff --git a/build b/build index fc921a903..166df99f9 100755 --- a/build +++ b/build @@ -14,6 +14,8 @@ PROTO_FILES=`find src -name *.proto` # make variables available to sub-scripts export SRC TARGET PROTO_FILES +set -e + # cpp/java/python supported by protoc ./build_protoc # ruby supported by rprotoc diff --git a/build_protoc b/build_protoc index b712a8115..452a2dc25 100755 --- a/build_protoc +++ b/build_protoc @@ -7,8 +7,6 @@ TARGET_CPP="$TARGET/cpp" mkdir -p "$TARGET_CPP" -PROTOC_ARGS="--cpp_out=$TARGET/cpp" - # if you don't want to put protoc on the command line, # then set a PROTOC environment variable if [ -z $PROTOC] ; then @@ -20,4 +18,5 @@ command -v $PROTOC >/dev/null 2>&1 || { echo >&2 "protoc is required but not ins # die on error at this point set -e -$PROTOC $PROTO_FILES --cpp_out=$TARGET/cpp --proto_path=$SRC +echo "building cpp protocol buffers" +$PROTOC $PROTO_FILES --cpp_out=$TARGET_CPP --proto_path=$SRC diff --git a/build_protoc-c b/build_protoc-c index f3618ca8f..ab88764fe 100755 --- a/build_protoc-c +++ b/build_protoc-c @@ -19,4 +19,5 @@ command -v $PROTOCC >/dev/null 2>&1 || { echo >&2 "protoc-c is required but not # die on error at this point set -e +echo "building c protocol buffers" $PROTOCC $PROTO_FILES --c_out=$TARGET_C --proto_path=$SRC diff --git a/build_rprotoc b/build_rprotoc index ba33fb02a..cdc6c853e 100755 --- a/build_rprotoc +++ b/build_rprotoc @@ -8,14 +8,12 @@ RUBY_OUT=$TARGET/ruby command -v "bundle" >/dev/null 2>&1 || { echo >&2 "bundle is required but not installed. Skipping ruby protocol buffers."; exit 0; } # creates a bin folder with 'rprotoc' command inside -bundle install --binstubs +bundle install --binstubs > /dev/null # die on error at this point set -e -for i in "${PROTO_FILES[@]}" -do - bin/rprotoc --proto_path $SRC --out $RUBY_OUT "$i" -done +echo "building ruby protocol buffers" +bin/ruby-protoc $PROTO_FILES --proto_path $SRC --ruby_out $RUBY_OUT diff --git a/src/login.proto b/src/login.proto index 944f67584..4f960f2ca 100644 --- a/src/login.proto +++ b/src/login.proto @@ -1,4 +1,4 @@ message Login { - required string session_id = 1; - required string username = 2; + optional string username = 1; // username + optional string token = 2; // a token provided by the server that validates this user }