Commit Graph

162 Commits

Author SHA1 Message Date
Carl Mastrangelo 7ce2b4f81d all: start 1.3.0 development cycle 2017-03-06 13:12:44 -08:00
Eric Anderson 10cbd49dbf examples: Always pass an executor to Futures.addCallback()
The executor-less version is being removed, as having the executor
explicitly specified is less bug-prone.
2017-03-06 08:40:32 -08:00
Eric Anderson d7d0d73146 examples: Update imports to new-style 2017-03-03 11:48:46 -08:00
Eric Anderson 2eeb5e3e9e all: Downgrade to Guava 19
Guava 20 introduced some overloading optimizations for Preconditions
that require using Guava 20+ at runtime. Unfortunately, Guava 20 removes
some things that is causing incompatibilities with other libraries, like
Cassandra. While the incompatibility did trigger some of those libraries
to improve compatibility for newer Guavas, we'd like to give the
community more time to work through it. See #2688

At this commit, we appear to be compatible with Guava 18+. It's not
clear if we want to actually "support" 18, but it did compile. Guava 17
doesn't have at least MoreObjects, directExecutor, and firstNotNull.
Guava 21 compiles without warnings, so it should be compatible with
Guava 22 when it is released.

One test method will fail with the upcoming Guava 22, but this won't
impact applications. I made MoreThrowables to avoid using any
known-deprecated Guava methods in our JARs, to reduce pain for those
stuck with old versions of gRPC in the future (July 2018).

In the stand-alone Android apps I removed unnecessary explicit deps
instead of syncing the version used.
2017-02-28 09:23:04 -08:00
Eric Anderson 5ca4ea7272 examples: Split thrift from the multi-project build
grpc-thrift isn't published yet, which causes build breakage for people
trying to do the protobuf example.

Fixes #2681 (ONCE AND FOR ALL!)
2017-02-24 10:04:02 -08:00
Carl Mastrangelo b0323ac22c all: update to protobuf 3.2.0 2017-02-07 09:47:15 -08:00
Carl Mastrangelo e8aef5b4bb Start 1.2.0 development cycle 2017-01-30 16:40:12 -08:00
Eric Anderson 06c40dccc3 android: Fix ProGuard rules in Android apps
Fixes #2207. This is actually a workaround. Ideally users shouldn't need
to -keep classes, but it's a bit risky to fix the real issue before 1.1.
The further fix will be done as part of #2633.

The interop app's build.gradle change is necessary to compile with newer
Gradle versions. The com.google.errorprone.annotations was necessary in
order to prevent annotation warnings from failing the build.
2017-01-23 09:11:09 -08:00
Kun Zhang d0d2c1e796 docs: add links to examples and tutorials. (#2614) 2017-01-18 09:06:45 -08:00
Kun Zhang 1aaf1a989c compiler: final bindService() in generated code. (#2553)
So that it won't be overridden by Mockito when it creates a mock for
the server interface.
2016-12-29 10:32:47 -08:00
Carl Mastrangelo ce9d152dff all: update to guava 20 2016-12-16 15:15:17 -08:00
Carl Mastrangelo 18e628ab1d all: update to gradle 3.2
* all: update to gradle 3.2
2016-11-23 14:43:18 -08:00
Kun Zhang 325c965fdc example: really fix the loss of precision error (#2435) 2016-11-22 22:17:36 -08:00
Kun Zhang a05892a9fe examples: address ErrorProne and warnings. (#2433)
Discovered when importing grpc to internal repo:

1. ErrorProne: Compound assignments from floating point to integral
types hide dangerous casts.

2. found raw type: io.grpc.ManagedChannelBuilder missing type arguments
  for generic class io.grpc.ManagedChannelBuilder<T>
2016-11-22 15:17:44 -08:00
Carl Mastrangelo e0e13c4897 examples: don't use System.lineSeparator if unsupported
Fixes: #2425
2016-11-16 16:02:17 -08:00
ZHANG Dapeng 7306df4266 examples: unit test examples for users
Demonstrate unit testing gRPC clients and servers with `InProcessTransport`.
2016-11-15 14:15:55 -08:00
Benjamin Ellenberger 8826bb5e3e Remove UTF-8 symbols in example to simplify compilation for most people. 2016-11-14 21:49:34 -08:00
Eric Anderson c38611a230 Bump protobuf to 3.1.0
Also removed warnings about protoc version matching runtime, since this
is no longer supposed to be a problem (starting with 3.0.0-beta-4) and
all our tests ran fine when using protoc 3.0.2 with protobuf runtime
3.1.0.

Fixes #2316
2016-11-01 14:52:56 -07:00
Eric Anderson b1d72e5c3e all: Bump protobuf to 3.0.2, to fix protoc in CI
protoc no longer builds in 3.0.0 because auto-download of the gmock zip
now fails. 3.0.2 has a fix to autogen:
bba446bbf2

All that was strictly necessary was to update .travis.yml and
buildscripts/, but it helps our sanity to keep the rest of the protobuf
versions in sync. Lite is left on its existing version, because it did
not see a bump of neither the java library nor the protoc plugin.
2016-09-29 10:25:31 -07:00
ZHANG Dapeng 16c07ba434 examples: fix bound method not same as in service descriptor for HelloJsonServer
Fix the following issue.
HelloJsonServer fails to start:
````
Exception in thread "main" java.lang.IllegalStateException: Bound method for helloworld.Greeter/SayHello not same instance as method in service descriptor
    at io.grpc.ServerServiceDefinition$Builder.build(ServerServiceDefinition.java:156)
    at io.grpc.examples.advanced.HelloJsonServer.bindService(HelloJsonServer.java:131)
    at io.grpc.examples.advanced.HelloJsonServer.start(HelloJsonServer.java:70)
    at io.grpc.examples.advanced.HelloJsonServer.main(HelloJsonServer.java:105)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
````
2016-09-15 17:24:28 -07:00
Kun Zhang 9d747bbbcd build: upgrade to protobuf-gradle-plugin 0.8.0 2016-08-18 13:06:18 -07:00
Xiao Hang 0d89bb4942 Update android example.
Show the full stacktrace when error happens and make the result text view scrollable.
2016-08-17 14:17:32 -07:00
Eric Anderson bcf6cc51ca Simplify commands in Android README
Comments should really use '#', since it is shell. Also, we avoid
telling users to clone the git repo since 1) this is basically implicit
already and 2) it encourages them to checkout master instead of using
the latest release. This is especially helpful when the document is
referenced from http://grpc.io/docs since they specify checking out the
latest release (which is much easier to maintain when using jekyll which
is not an option here).
2016-08-17 14:12:41 -07:00
Xiao Hang 3879c6a8fa Update README.md 2016-08-09 14:05:49 -07:00
Eric Anderson 09d7a41946 examples: Explain reason for plainText() 2016-08-04 15:33:36 -07:00
Xiao Hang 7267c0fbed Change routeguide example to use proto 3.0.0 2016-08-04 11:47:53 -07:00
Eric Anderson ab85d8751b Update to Gradle 2.14
Is faster and includes a security fix.
2016-08-04 10:03:57 -07:00
Xiao Hang 239d6ea299 Add android route guide example and move helloworld example to its own dir 2016-08-03 14:47:10 -07:00
Eric Anderson 5e1e88357c Update protobuf to 3.0.0
Fixes #2086
2016-07-29 09:31:15 -07:00
TzeKei Lee fccc282f25 examples: add an example for setting and reading error details
Add an example for setting and reading error details
2016-07-29 09:28:15 -07:00
Naveen Reddy Chedeti 2860959d5f Support Thrift Messages 2016-07-28 08:48:27 -07:00
Xiao Hang 2506e9396a Fix examples README 2016-07-27 16:50:19 -07:00
Eric Anderson fbd3f529ef android: Remove providers from ProGuard configuration
We are no longer using resources to load providers on Android. Instead,
we are calling Class.forName() for known providers. ProGuard is able to
detect these usages automatically.
2016-07-25 14:43:08 -07:00
ZHANG Dapeng e109125c62 compiler: add build option to enable deprecated generated code
partially resolving #1469

The added option for java_plugin `enable_deprecated` is `true` by default in `java_plugin.cpp`, so the generated code for `TestService.java` (`compiler/build.gradle` not setting this option) has all deprecated interfaces and static bindService method.

`./build.gradle` and `examples/build.gradle` set this option explicitly to `false`, so all the other generated classes do not have deprecated code.

Will set `enable_deprecated` to `false` by default in future PR when we are ready.
2016-07-21 16:35:18 -07:00
Eric Anderson e9643bb5d7 Start 1.1.0 development cycle 2016-07-11 16:57:58 -07:00
Eric Anderson d7bf67e01f examples: Provide Maven and Gradle build files
The examples are no longer part of the normal build, although they are
built with Travis. The examples now include their own copy of the gradle
wrapper to ease usage from IDEs which can now properly detect the
correct version of gradle to use.

The build files were generated using "gradle init" and "mvn
archetype:generate" and then modified following our README.

Fixes #1414
2016-07-11 09:20:25 -07:00
Eric Anderson 46379da1a6 Start 1.0.0 development cycle 2016-07-01 11:46:33 -07:00
Eric Anderson 75f27ba625 examples: Avoid deprecated generated class 2016-07-01 11:21:48 -07:00
nmittler 8f78b4d88e Fixing error-prone warnings. 2016-07-01 10:03:41 -07:00
ZHANG Dapeng f149e4c175 compiler: deprecate interfaces and add ImplBase in codegen
first step to address issue #1469:

- leave and deprecate interfaces in codegen
- introduce `ServiceImplBase`,
- `AbstractService` is deprecated and extends `ServiceImplBase`
- static `bindService()` is deprecated
2016-06-29 21:17:03 -07:00
Carl Mastrangelo dc027ff346 examples: add an example showing how to get the error details from a call
Fixes #1295
2016-06-28 16:10:38 -07:00
David Cao 4b17a2e317 Android hello world example is now using proto lite. 2016-06-28 14:34:00 -07:00
Eric Anderson dbef1af29a Bump protobuf dependency to 3.0.0-beta-3
This allows us to play with zero-copy and proto3 support for lite.
Unfortunately, it introduced some warnings, so deprecated warnings are
now ignored for benchmarks and interop-testing.
2016-06-28 08:58:13 -07:00
Carl Mastrangelo a10712b515 examples: move json server and client to advanced package
Fixes: #1778 (again)
2016-06-24 10:40:02 -07:00
Eric Anderson 66ab956f9e Reapply "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit ef178304cb, which
itself was a revert.
2016-06-23 09:27:47 -07:00
Eric Anderson 4372ceee06 android: Add ProGuard rules for NameResolverProvider
Without the rules, all RPCs fail since no providers are found. We like
the idea of RPCs working.
2016-06-21 14:57:31 -07:00
Eric Anderson ef178304cb Revert "Eliminate MethodDescriptor from startCall and interceptCall for servers"
This reverts commit 3df1446deb.

The commit was adding to the difficulty of integration for testing. By
itself it isn't bad, so this is a temporary revert until the many other
commits are absorbed and then it will be reapplied.

This does have a manual edit for ClientCallsTest.
2016-06-20 15:18:18 -07:00
Eric Anderson a2076f4ec8 core: Enable per-message compression bit by default
This does not enable compression by default, but if the application
chooses to enable compression for a Call, messages will be compressed
without also needing to enable per-message compression.

Disabling per-message compression is intended as a security feature and
should be relatively rarely used, but it was the default. Thus we
required clients to use more advanced interfaces unnecessarily.

To keep client and server behavior consistent, the server also has
per-message compression enabled by default. However, to prevent
compressing on the wire by default, servers no longer enable compression
for the response by default.
2016-06-14 10:51:32 -07:00
Carl Mastrangelo df346e3a86 examples: make JSON code more obviously advanced 2016-06-14 09:23:28 -07:00
Louis Ryan 3df1446deb Eliminate MethodDescriptor from startCall and interceptCall for servers
Make the MethodDescriptor a property of ServerCall
Move ServerMethodDefinition into ServerServiceDefinition
2016-06-13 14:39:58 -07:00