* trying out container type
This commit is contained in:
parent
47322c2be5
commit
00dd36a8f7
2
Gemfile
2
Gemfile
|
|
@ -1,3 +1,3 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
gem 'ruby_protobuf', '0.4.11'
|
||||
gem 'ruby-protocol-buffers'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
2
build
2
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue