* initial build ready (i think)
This commit is contained in:
commit
6ea02c11d3
|
|
@ -0,0 +1,5 @@
|
||||||
|
target
|
||||||
|
*.swp
|
||||||
|
*~
|
||||||
|
bin
|
||||||
|
.bundle
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
|
gem 'ruby_protobuf', '0.4.11'
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
ruby_protobuf (0.4.11)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
ruby_protobuf (= 0.4.11)
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
Jam-Pb (Protocol Buffers)
|
||||||
|
=========================
|
||||||
|
|
||||||
|
Environment
|
||||||
|
-----------
|
||||||
|
|
||||||
|
Download and install protoc 2.4.1 on the command-line:
|
||||||
|
http://code.google.com/p/protobuf/downloads/list
|
||||||
|
|
||||||
|
Bash
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
./build
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
TARGET=target
|
||||||
|
SRC=src
|
||||||
|
|
||||||
|
# clean
|
||||||
|
rm -rf $TARGET
|
||||||
|
# prep output
|
||||||
|
mkdir $TARGET
|
||||||
|
|
||||||
|
# find all protocol buffer files in src directory
|
||||||
|
PROTO_FILES=`find src -name *.pb`
|
||||||
|
|
||||||
|
# make variables available to sub-scripts
|
||||||
|
export SRC TARGET PROTO_FILES
|
||||||
|
|
||||||
|
# cpp/java/python supported by protoc
|
||||||
|
./build_protoc
|
||||||
|
# ruby supported by rprotoc
|
||||||
|
./build_rprotoc
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this build file uses protoc to build all protocol buffers
|
||||||
|
# http://code.google.com/p/protobuf/downloads/list
|
||||||
|
|
||||||
|
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
|
||||||
|
PROTOC="protoc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
command -v $PROTOC >/dev/null 2>&1 || { echo >&2 "protoc is required but not installed. Aborting."; exit 1; }
|
||||||
|
|
||||||
|
# die on error at this point
|
||||||
|
set -e
|
||||||
|
|
||||||
|
$PROTOC $PROTO_FILES --cpp_out=$TARGET/cpp --proto_path=$SRC
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# ruby protocol buffers
|
||||||
|
# http://code.google.com/p/ruby-protobuf/
|
||||||
|
RUBY_OUT=$TARGET/ruby
|
||||||
|
|
||||||
|
# we exit with 0; treat ruby as optional at the moment
|
||||||
|
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
|
||||||
|
|
||||||
|
# die on error at this point
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for i in "${PROTO_FILES[@]}"
|
||||||
|
do
|
||||||
|
bin/rprotoc --proto_path $SRC --out $RUBY_OUT "$i"
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
message Login {
|
||||||
|
required string session_id = 1;
|
||||||
|
required string username = 2;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue