Skip to content

Commit

Permalink
Merge pull request grpc#7508 from murgatroid99/v1.0.x_merge_into_master
Browse files Browse the repository at this point in the history
V1.0.x merge into master
  • Loading branch information
nicolasnoble authored Jul 25, 2016
2 parents cc961b6 + 1533e6a commit 01da196
Show file tree
Hide file tree
Showing 143 changed files with 4,029 additions and 2,258 deletions.
48 changes: 26 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,37 @@ env:
- TEST=objc
- JOBS=1
matrix:
- SCHEME="RxLibraryUnitTests" WORKSPACE="Tests.xcworkspace"
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
- SCHEME="RxLibraryUnitTests"
WORKSPACE="Tests.xcworkspace" TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
INTEROP_SERVER="false"
- SCHEME="InteropTestsLocalSSL" WORKSPACE="Tests.xcworkspace"
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false" INTEROP_SERVER="true"
- SCHEME="InteropTestsLocalCleartext" WORKSPACE="Tests.xcworkspace"
TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
- SCHEME="InteropTestsLocalSSL"
WORKSPACE="Tests.xcworkspace" TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
INTEROP_SERVER="true"
- SCHEME="InteropTestsLocalCleartext"
WORKSPACE="Tests.xcworkspace" TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
INTEROP_SERVER="true"
# TODO(jcanizales): Make tests an app project (instead of library), so the following will work.
# - SCHEME="InteropTestsRemote" WORKSPACE="Tests.xcworkspace"
# TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
# - SCHEME="InteropTestsRemote"
# WORKSPACE="Tests.xcworkspace" TEST_PATH="src/objective-c/tests" BUILD_ONLY="false"
# INTEROP_SERVER="true"
- SCHEME="HelloWorld" WORKSPACE="HelloWorld.xcworkspace"
TEST_PATH="examples/objective-c/helloworld" BUILD_ONLY="true"
INTEROP_SERVER="false"
- SCHEME="RouteGuideClient" WORKSPACE="RouteGuideClient.xcworkspace"
TEST_PATH="examples/objective-c/route_guide" BUILD_ONLY="true"
INTEROP_SERVER="false"
- SCHEME="AuthSample" WORKSPACE="AuthSample.xcworkspace"
TEST_PATH="examples/objective-c/auth_sample" BUILD_ONLY="true"
INTEROP_SERVER="false"
- SCHEME="Sample" WORKSPACE="Sample.xcworkspace"
TEST_PATH="src/objective-c/examples/Sample" BUILD_ONLY="true"
INTEROP_SERVER="false"
- SCHEME="SwiftSample" WORKSPACE="SwiftSample.xcworkspace"
TEST_PATH="src/objective-c/examples/SwiftSample" BUILD_ONLY="true"
- SCHEME="HelloWorld"
WORKSPACE="HelloWorld.xcworkspace" TEST_PATH="examples/objective-c/helloworld"
BUILD_ONLY="true" INTEROP_SERVER="false"
- SCHEME="RouteGuideClient"
WORKSPACE="RouteGuideClient.xcworkspace" TEST_PATH="examples/objective-c/route_guide"
BUILD_ONLY="true" INTEROP_SERVER="false"
- SCHEME="AuthSample"
WORKSPACE="AuthSample.xcworkspace" TEST_PATH="examples/objective-c/auth_sample"
BUILD_ONLY="true" INTEROP_SERVER="false"
- SCHEME="Sample"
WORKSPACE="Sample.xcworkspace" TEST_PATH="src/objective-c/examples/Sample" BUILD_ONLY="true"
INTEROP_SERVER="false"
- SCHEME="Sample"
WORKSPACE="Sample.xcworkspace" TEST_PATH="src/objective-c/examples/Sample" BUILD_ONLY="true"
INTEROP_SERVER="false" FRAMEWORKS="YES"
- SCHEME="SwiftSample"
WORKSPACE="SwiftSample.xcworkspace" TEST_PATH="src/objective-c/examples/SwiftSample"
BUILD_ONLY="true" INTEROP_SERVER="false"
before_install:
# Until Travis upgrades from Cocoapods 0.39, we need to do it here.
- pod --version
Expand Down
2 changes: 1 addition & 1 deletion PYTHON-MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ graft include/grpc
graft third_party/boringssl
graft third_party/nanopb
graft third_party/zlib
include src/python/grpcio/build.py
include src/python/grpcio/_unixccompiler_patch.py
include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py
include src/python/grpcio/grpc_core_dependencies.py
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ task 'dlls' do
env += 'EMBED_ZLIB=true '
env += 'BUILDDIR=/tmp '
env += "V=#{verbose} "
out = '/tmp/libs/opt/grpc-0.dll'
out = '/tmp/libs/opt/grpc-1.dll'

w64 = { cross: 'x86_64-w64-mingw32', out: 'grpc_c.64.ruby' }
w32 = { cross: 'i686-w64-mingw32', out: 'grpc_c.32.ruby' }
Expand Down
2 changes: 2 additions & 0 deletions doc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/
src/
1,293 changes: 784 additions & 509 deletions etc/roots.pem

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion examples/cpp/helloworld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++ grpc` -lprotobuf -lpthread -ldl
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++ grpc` \
-Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed \
-lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
Expand Down
4 changes: 3 additions & 1 deletion examples/cpp/route_guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` -lprotobuf -lpthread -ldl
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` \
-Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed \
-lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
Expand Down
2 changes: 1 addition & 1 deletion examples/objective-c/auth_sample/AuthTestService.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
src = "../../protos"

# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1"

# Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
pods_root = 'Pods'
Expand Down
2 changes: 1 addition & 1 deletion examples/objective-c/helloworld/HelloWorld.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
src = "../../protos"

# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1"

# Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
pods_root = 'Pods'
Expand Down
2 changes: 1 addition & 1 deletion examples/objective-c/route_guide/RouteGuide.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
src = "../../protos"

# Run protoc with the Objective-C and gRPC plugins to generate protocol messages and gRPC clients.
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 0.14"
s.dependency "!ProtoCompiler-gRPCPlugin", "~> 1.0.0-pre1"

# Pods directory corresponding to this app's Podfile, relative to the location of this podspec.
pods_root = 'Pods'
Expand Down
10 changes: 4 additions & 6 deletions examples/python/helloworld/greeter_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@

from __future__ import print_function

from grpc.beta import implementations
import grpc

import helloworld_pb2

_TIMEOUT_SECONDS = 10


def run():
channel = implementations.insecure_channel('localhost', 50051)
stub = helloworld_pb2.beta_create_Greeter_stub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), _TIMEOUT_SECONDS)
channel = grpc.insecure_channel('localhost:50051')
stub = helloworld_pb2.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)


Expand Down
8 changes: 6 additions & 2 deletions examples/python/helloworld/greeter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,25 @@

"""The Python implementation of the GRPC helloworld.Greeter server."""

from concurrent import futures
import time

import grpc

import helloworld_pb2

_ONE_DAY_IN_SECONDS = 60 * 60 * 24


class Greeter(helloworld_pb2.BetaGreeterServicer):
class Greeter(helloworld_pb2.GreeterServicer):

def SayHello(self, request, context):
return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name)


def serve():
server = helloworld_pb2.beta_create_Greeter_server(Greeter())
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
helloworld_pb2.add_GreeterServicer_to_server(Greeter(), server)
server.add_insecure_port('[::]:50051')
server.start()
try:
Expand Down
63 changes: 52 additions & 11 deletions examples/python/helloworld/helloworld_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 13 additions & 3 deletions examples/python/route_guide/run_codegen.sh → examples/python/helloworld/run_codegen.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
Expand Down Expand Up @@ -28,5 +27,16 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Runs the protoc with gRPC plugin to generate protocol messages and gRPC stubs.
python -m grpc.tools.protoc -I../../protos --python_out=. --grpc_python_out=. ../../protos/route_guide.proto
"""Runs protoc with the gRPC plugin to generate messages and gRPC stubs."""

from grpc.tools import protoc

protoc.main(
(
'',
'-I../../protos',
'--python_out=.',
'--grpc_python_out=.',
'../../protos/helloworld.proto',
)
)
1 change: 1 addition & 0 deletions examples/python/multiplex/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pyc
1 change: 1 addition & 0 deletions examples/python/multiplex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An example showing two stubs sharing a channel and two servicers sharing a server.
Loading

0 comments on commit 01da196

Please sign in to comment.