Commit Graph

93 Commits

Author SHA1 Message Date
Eric Anderson a3ff9cd784 all: Keep artifacts dependencyConvergence-clean
Maven Enforcer's dependencyConvergence is commonly used in Spring
projects, as it is inherited by all starter projects[1]. While I find
that option to be crazy and harmful (and would instead support
requireUpperBoundDeps), it does bother people.

1. https://github.com/spring-projects/spring-boot/blob/v1.5.6.RELEASE/spring-boot-starters/pom.xml#L94
2017-09-18 16:20:18 -07:00
Lukasz Strzalkowski 731bbefb17 core, compiler, protobuf: introduce MethodDescriptor#setSchemaDescriptor 2017-09-11 09:57:03 -07:00
Paul Gross 72b9ee22b8 all: Fix mismatch in naming Bazel Maven jars
This commit aligns the naming of the Bazel Maven jars with the names
used by Bazel's migration-tooling project:

https://github.com/bazelbuild/migration-tooling

Unfortunately, we can't fix @com_google_protobuf_java because it's
required by Bazel itself.

Fixes #3328
2017-08-11 16:39:43 -07:00
ZHANG Dapeng c2791496ca fix misuse of bazel repo @com_google_protobuf
resolves #3175
2017-07-05 16:15:33 -07:00
ZHANG Dapeng 69e278aa8e protobuf: configureProtoCompilation() not needed anymore 2017-07-05 15:52:18 -07:00
Eric Anderson c436561fc5 all: Use fixed version number for java 6/7 signatures
This is important for stable builds, as if the signature changes the old source
may no longer validate.
2017-06-30 15:25:34 -07:00
Simon Horlick 6d9e149dcb build: Add Bazel java_grpc_library rule
Bazel third party dependencies are specified in repositories.bzl which
gives the consumer the ability to opt-out of any dependencies they use
directly in their own project.

Fixes #2756
2017-06-22 13:06:49 -07:00
Carl Mastrangelo 166108a943 all: fix licence whitespace 2017-06-01 14:28:37 -07:00
Carl Mastrangelo 3bfd630bff all: update to Apache 2 licence
Also, update the authors.
2017-05-31 13:29:01 -07:00
Eric Gribkoff 37e2131dc9 protobuf: make toStatusProto return null when metadata key is absent 2017-05-30 11:47:20 -07:00
ZHANG Dapeng bb978bac31 doc: initiate some package javadoc
Initated package javadoc for 
* `io.grpc.stub`, 
* `io.grpc.auth`, 
* `io.grpc.util`, 
* `io.grpc.protobuf`, 
* `io.grpc.protobuf.lite`,
* `io.grpc.protobuf.nano`
2017-05-10 11:29:07 -07:00
Muxi Yan f674776a6c Add/Fix some docs (#2970)
* Add/Fix some docs

* Address comments

* Address comments

* Address comments

* Add remarks

* Build fixes

* Revision

* More revision
2017-05-04 10:57:49 -07:00
Eric Gribkoff df69485f44 build,protobuf: update google_api_protos dependency 2017-05-01 14:43:53 -07:00
Eric Gribkoff 6cf8f059c9 protobuf: utility methods for com.google.rpc.Status 2017-03-21 14:03:46 -07:00
Eric Anderson 42aa64c647 all: swap to newer animalsniffer plugin
The new plugin uses a newer version of animalsniffer, allows overriding
the animalsniffer version used, and has up-to-date handling. The
up-to-date handling cuts fully incremental parallel build times in half,
from 5.5s to 2.7s.

The previous plugin was supposed to be verifying tests. However, either
it wasn't verifying them or its verification was broken.
2017-02-07 12:49:01 -08:00
Carl Mastrangelo 89bc2cd3b2 all: update to latest import ordering 2017-01-26 13:43:06 -08:00
Carl Mastrangelo 3144a4fcd6 proto: remove deprecated methods 2017-01-11 13:23:02 -08:00
dave 540f70e870 ProtoUtil.jsonMarshaller can be supplied a JsonFormat Parser and Printer
This allows for customizing the printer and parser behaviour
2016-11-02 15:24:13 -07:00
Eric Gribkoff abffc76da2 addressing reviewer comments 2016-10-28 08:45:32 -07:00
Eric Gribkoff aff1cac7da Compiler/core changes to support the proto reflection API
core: adds @Nullable Object getAttachedObject() to ServiceDescriptor

compiler: Plumbing necessary to access proto file descriptors via
the reflection service
2016-10-28 08:45:32 -07:00
Eric Anderson a8700a7837 Begin consuming protobuf-lite artifact
Protobuf-lite since beta-4 is now more of a fork than a subset of
protobuf-java, which may cause us problems later since lite API is not
stable. Also, lite-generated code may now depend on APIs only in
protobuf-lite, so our users must depend on the protobuf-lite runtime.
Having all our users explicitly override the dependency is bothersome to
them and can easily only expose problems only after we do a release.

So now we are doing the dependency overriding; most users should "just
work" and pick up the correct protobuf artifact. I've confirmed the
exclusion is listed in the grpc-protobuf pom and "gradle dependencies"
and "mvn dependency:tree" do not include protobuf-lite for the examples.
Vanilla protobuf users are most likely to experience any breakage, which
should detect problems more quickly since we use protobuf-java more
frequently than protobuf-lite during development.

protobuf-lite does not include pre-generated code for the well-known
protos, so users will need to generate them themselves for the moment
(google/protobuf#1889).

Note that today changing deps does not noticeably reduce the method code
for our users, since ProGuard already is stripping most classes. The
difference in output is only a reduction of 3 classes and 6 methods for
the android example.
2016-08-01 15:51:11 -07:00
nmittler d9d4d8b70f Updating status codes to match the spec.
Fixes #1605
2016-05-09 13:55:50 -07:00
Carl Mastrangelo bc661e7fbb all: Finish adding tracking issues for ExperimentalApi 2016-05-03 16:15:57 -07:00
Eric Anderson f83db83391 Add unit tests for proto-based JSON marshaller 2016-04-29 10:31:43 -07:00
Carl Mastrangelo 702518af22 Allow use of a global ExtensionRegistry 2016-04-15 17:36:45 -07:00
Eric Anderson 99a6d8de27 Add native support for Protobuf Lite
Lite already worked by using the protobuf project, but would bring in
extra dependencies that are not intended to work with lite. Although
protobuf is not yet providing a lite package on Maven Central, we will
be able to swap to it once it is available.

There isn't any new original code in the Java portion, except for a new
overload in ProtoUtils that accepts Message instead of MessageLite.
Depending on Message in ProtoUtils allows us to support extra features
out-of-the-box without any changes to the generated code. For example,
JSON encoding could be supported in this way if Marshaller is enhanced.

However, now codegen must be aware of Lite in order to choose with Util
class to use. That is new code.
2016-03-22 15:40:51 -07:00
Carl Mastrangelo 9913d1d0fc Initial attempt at json example 2016-03-10 11:33:06 -08:00
Eric Anderson 52bd63f88e Improve test coverage of ProtoUtils
NanoUtilsTest was updated to use an invalid proto instead of an
IOException to match ProtoUtils and to be more realistic.
2016-02-06 17:22:37 -08:00
Eric Anderson 4573836df9 Fix NPE in ProtoInputStream.drainTo
Fixes #1225
2016-02-01 15:16:17 -08:00
Carl Mastrangelo 05b7d75029 Re add support for periods in metadata key names 2015-11-10 15:59:42 -08:00
Carl Mastrangelo 2ad35b8269 Add Header name character restrictions 2015-11-10 11:20:04 -08:00
Eric Anderson cea8e8e4a7 Add tests for nano proto
Since some of the tests would need only minor modification to work for
normal proto, normal proto got a few more tests as well.
2015-10-28 10:00:41 -07:00
Eric Anderson 47a7ccf0cb Avoid Parser for normal protobuf
Eventually, this could avoid allocating Parser, since we can use
newBuilderForType().mergeFrom(). This would primarily benefit Lite
proto.
2015-09-03 17:31:16 -07:00
Kun Zhang bd23a8d693 Upgrade to protobuf-3.0.0-beta-1 2015-08-31 09:26:20 -07:00
nmittler 0b57f56bf0 Reducing the size of the "large" proto in ProtoUtilsTest.
Hoping to eliminate flakes on Travis.

Fixes #859
2015-08-24 08:40:58 -07:00
nmittler 573f79a06d Remove proto size restriction when parsing protos. 2015-08-20 14:10:49 -07:00
Eric Anderson 22c4991d7f Enable Animal Sniffer for protobuf projects
This ensures that we remain JDK6/Android-compatible.
2015-08-14 08:34:16 -07:00
Kun Zhang f681b5f8be Move Marshaller into MethodDescriptor 2015-08-11 10:53:38 -07:00
Eric Anderson 3059b70283 Optimize protobuf serializer for in-memory transport
In-memory transport provides back the same input stream that was
provided, so if we notice our own object simply avoid serializing.

DeferredProtoInputStream is made package-private because 1) it doesn't
seem we need it to be public and 2) the change depends on it being
package-private so the constructor can be changed.
2015-07-22 15:54:39 -07:00
Kun Zhang a6585e36ed Replace DeferredInputStream with interface Drainable.
- Rename flushTo() to drainTo().
- Remove flushTo() from DeferredNanoProtoInputStream (which is renamed
  to NanoProtoInputStream), because the optimization is not implemented.
- Rename DeferredProtoInputStream to ProtoInputStream.

 #529
2015-07-20 17:04:49 -07:00
Louis Ryan 641fc288fc Add support for indeterminate length messages. This will make using GRPC easier for non-proto payload types.
Sync to head
2015-05-26 15:44:46 -07:00
Eric Anderson 3666de4427 Use more precise names for protobuf and nano
io.grpc.nano sort of seems like a "small" version of grpc-java. And
io.grpc.proto could also mean multiple things. Using "protobuf"
and "protobuf nano" gets us consistent names that are still
understandable, predictable, and more similar to protobuf project
itself.
2015-04-10 16:35:23 -07:00
Eric Anderson e23f899491 Split protobuf into its own project
We don't want core to depend on protobuf.
2015-04-10 15:50:56 -07:00