diff options
author | 2016-04-12 12:22:20 +0000 | |
---|---|---|
committer | 2016-04-12 13:59:09 +0000 | |
commit | e21e592a4079c310522eb2cc23aa49367ba48127 (patch) | |
tree | 0a72a4af983e9da7711e954dac27b25b97a26400 /src/main/java/com/google/devtools | |
parent | 1250fdac4c7769cfa200af8b4f9b061024356fea (diff) |
Add stub gRPC C++ client and Java server.
The code doesn't do anything yet and it's unused code for now. This change only serves to add all the necessary dependencies to BUILD files that gRPC needs.
--
MOS_MIGRATED_REVID=119628697
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/BUILD | 2 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/server/GrpcServer.java | 31 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/BUILD b/src/main/java/com/google/devtools/build/lib/BUILD index e0e2e81490..fdae7079e3 100644 --- a/src/main/java/com/google/devtools/build/lib/BUILD +++ b/src/main/java/com/google/devtools/build/lib/BUILD @@ -859,10 +859,12 @@ java_library( "//src/main/java/com/google/devtools/build/skyframe", "//src/main/java/com/google/devtools/common/options", "//src/main/protobuf:build_java_proto", + "//src/main/protobuf:command_server_java_proto", "//src/main/protobuf:invocation_policy_java_proto", "//src/main/protobuf:test_status_java_proto", "//third_party:joda_time", "//third_party:jsr305", + "//third_party/grpc:grpc-jar", "//third_party/protobuf", ], ) diff --git a/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java b/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java new file mode 100644 index 0000000000..3674da8a53 --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/server/GrpcServer.java @@ -0,0 +1,31 @@ +// Copyright 2016 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.lib.server; + +import io.grpc.stub.StreamObserver; + +/** + * Unused class just to make sure that we can compile with gRPC. + */ +public class GrpcServer implements CommandServerGrpc.CommandServer { + @Override + public void run(CommandProtos.Request request, StreamObserver<CommandProtos.Response> observer) { + CommandProtos.Response response = CommandProtos.Response.newBuilder() + .setNumber(request.getNumber() + 1) + .build(); + observer.onNext(response); + observer.onCompleted(); + } +} |