Commit Graph

144 Commits

Author SHA1 Message Date
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
Eric Anderson 7c722e440e codegen: Specify URL for ExperimentalApi
Fixes #1378. These are the last ExperimentalApis that didn't have their
own separate tracking issue.
2016-06-07 15:00:29 -07:00
Eric Anderson 446f0cb85f Upgrade to Gradle 2.13
This improves our documentation for the gradle protobuf plugin, as its
version is dependent on the gradle version.

Gradle now has the --tests flag, performance improvements, and support
for OpenPGP subkeys.
2016-05-09 09:36:13 -07:00
Carl Mastrangelo 3c5b5a5e09 Begin v0.15.0 Cycle 2016-04-29 13:54:18 -07:00
nmittler 7e8b504e3f Add javadoc to grpc codegen based on proto docs
Fixes #1612
2016-04-22 13:23:17 -07:00
Eric Anderson 9bc5d93e4a Mark generated abstract class as Experimental 2016-04-19 12:35:04 -07:00
Eric Anderson 6ab27aba13 Update checkstyle version and sync style updates 2016-04-18 09:15:25 -07:00
Lukasz Strzalkowski 363e0f6cfc Print compiler version number in generated files 2016-04-11 19:35:19 -07:00
Lukasz Strzalkowski 2fbf142a41 Provide base methods for Abstract stub
Default implementation returns status UNIMPLEMENTED. This allows adding
new methods to services without breaking existing code.
2016-04-11 16:38:23 +02:00
Łukasz Strzałkowski 90fbf9b274 Adapt BindableService in ServerBuilder#addService
Makes binding services to server as simple as it can get.
2016-04-08 11:14:26 -07:00
Lukasz Strzalkowski f8b71e72b3 Add Abstract{ServiceName} class in compiled service class 2016-04-07 17:39:17 -07:00
Eric Anderson 0a01b3cf42 Simplify nano flag to codegen to just 'nano' from 'nano=true'
'nano=true' still works, but any value is now ignored. This is to align
with our lite flag, but also just because It's Cleaner.

Note that this is counter to what javanano does. Javanano requires all
flags have a value and uses true/false for many values.
2016-03-30 09:34:22 -07:00
Eric Anderson 13f0122b2f Clean up bitrot from Android example
Bump version of gRPC used, remove copy of gradle wrapper, and use
updated proto.

Fixes #1493
2016-03-25 13:52:03 -07:00
Carl Mastrangelo 9913d1d0fc Initial attempt at json example 2016-03-10 11:33:06 -08:00
Carl Mastrangelo ffe0dce85f Add missing override annotation to generated protos 2016-03-04 14:15:02 -08:00
Carl Mastrangelo c85e04698f Make Route Guide client and server accept channel and server builers, respectively. 2016-03-02 16:24:31 -08:00
Carl Mastrangelo 8e1fba7c90 Use Protobuf Json formatting for routeguide example 2016-03-02 10:10:15 -08:00
Carl Mastrangelo 72f1e88d78 Inlcude the file that was used to generate service descriptors 2016-03-01 09:22:10 -08:00
Eric Anderson b752e76858 Automated readability/efficiency tweaks
Although the changes were determined automatically, they were manually
applied to the codebase.

ClientCalls actually has a bug fix, since the suggestion to add
interrupt() made it obvious that interrupted() was inappropriate.
2016-02-16 14:15:23 -08:00