mirror of https://github.com/grpc/grpc.git
commit
136307756c
30 changed files with 8745 additions and 20 deletions
@ -0,0 +1,69 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#ifndef GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H |
||||
#define GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H |
||||
|
||||
#include <grpc++/impl/server_builder_plugin.h> |
||||
#include <grpc++/support/config.h> |
||||
|
||||
namespace grpc { |
||||
class ServerInitializer; |
||||
class ProtoServerReflection; |
||||
} // namespace grpc
|
||||
|
||||
namespace grpc { |
||||
namespace reflection { |
||||
|
||||
class ProtoServerReflectionPlugin : public ::grpc::ServerBuilderPlugin { |
||||
public: |
||||
ProtoServerReflectionPlugin(); |
||||
::grpc::string name() GRPC_OVERRIDE; |
||||
void InitServer(::grpc::ServerInitializer* si) GRPC_OVERRIDE; |
||||
void Finish(::grpc::ServerInitializer* si) GRPC_OVERRIDE; |
||||
void ChangeArguments(const ::grpc::string& name, void* value) GRPC_OVERRIDE; |
||||
bool has_async_methods() const GRPC_OVERRIDE; |
||||
bool has_sync_methods() const GRPC_OVERRIDE; |
||||
|
||||
private: |
||||
std::shared_ptr<::grpc::ProtoServerReflection> reflection_service_; |
||||
}; |
||||
|
||||
// Add proto reflection plugin to ServerBuilder. This function should be called
|
||||
// at the static initialization time.
|
||||
void InitProtoReflectionServerBuilderPlugin(); |
||||
|
||||
} // namespace reflection
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPCXX_EXT_PROTO_SERVER_REFLECTION_PLUGIN_H
|
@ -0,0 +1,184 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
|
||||
// Generated by the gRPC protobuf plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: reflection.proto
|
||||
// Original file comments:
|
||||
// Copyright 2016, Google Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
// Service exported by server reflection
|
||||
//
|
||||
#ifndef GRPC_reflection_2eproto__INCLUDED |
||||
#define GRPC_reflection_2eproto__INCLUDED |
||||
|
||||
#include <grpc++/ext/reflection.pb.h> |
||||
|
||||
#include <grpc++/impl/codegen/async_stream.h> |
||||
#include <grpc++/impl/codegen/async_unary_call.h> |
||||
#include <grpc++/impl/codegen/proto_utils.h> |
||||
#include <grpc++/impl/codegen/rpc_method.h> |
||||
#include <grpc++/impl/codegen/service_type.h> |
||||
#include <grpc++/impl/codegen/status.h> |
||||
#include <grpc++/impl/codegen/stub_options.h> |
||||
#include <grpc++/impl/codegen/sync_stream.h> |
||||
|
||||
namespace grpc { |
||||
class CompletionQueue; |
||||
class Channel; |
||||
class RpcService; |
||||
class ServerCompletionQueue; |
||||
class ServerContext; |
||||
} // namespace grpc
|
||||
|
||||
namespace grpc { |
||||
namespace reflection { |
||||
namespace v1alpha { |
||||
|
||||
class ServerReflection GRPC_FINAL { |
||||
public: |
||||
class StubInterface { |
||||
public: |
||||
virtual ~StubInterface() {} |
||||
// The reflection service is structured as a bidirectional stream, ensuring
|
||||
// all related requests go to a single server.
|
||||
std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { |
||||
return std::unique_ptr< ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); |
||||
} |
||||
std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { |
||||
return std::unique_ptr< ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); |
||||
} |
||||
private: |
||||
virtual ::grpc::ClientReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) = 0; |
||||
virtual ::grpc::ClientAsyncReaderWriterInterface< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) = 0; |
||||
}; |
||||
class Stub GRPC_FINAL : public StubInterface { |
||||
public: |
||||
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); |
||||
std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> ServerReflectionInfo(::grpc::ClientContext* context) { |
||||
return std::unique_ptr< ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(ServerReflectionInfoRaw(context)); |
||||
} |
||||
std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>> AsyncServerReflectionInfo(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { |
||||
return std::unique_ptr< ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>>(AsyncServerReflectionInfoRaw(context, cq, tag)); |
||||
} |
||||
|
||||
private: |
||||
std::shared_ptr< ::grpc::ChannelInterface> channel_; |
||||
::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflectionInfoRaw(::grpc::ClientContext* context) GRPC_OVERRIDE; |
||||
::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) GRPC_OVERRIDE; |
||||
const ::grpc::RpcMethod rpcmethod_ServerReflectionInfo_; |
||||
}; |
||||
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions()); |
||||
|
||||
class Service : public ::grpc::Service { |
||||
public: |
||||
Service(); |
||||
virtual ~Service(); |
||||
// The reflection service is structured as a bidirectional stream, ensuring
|
||||
// all related requests go to a single server.
|
||||
virtual ::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream); |
||||
}; |
||||
template <class BaseClass> |
||||
class WithAsyncMethod_ServerReflectionInfo : public BaseClass { |
||||
private: |
||||
void BaseClassMustBeDerivedFromService(const Service *service) {} |
||||
public: |
||||
WithAsyncMethod_ServerReflectionInfo() { |
||||
::grpc::Service::MarkMethodAsync(0); |
||||
} |
||||
~WithAsyncMethod_ServerReflectionInfo() GRPC_OVERRIDE { |
||||
BaseClassMustBeDerivedFromService(this); |
||||
} |
||||
// disable synchronous version of this method
|
||||
::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { |
||||
abort(); |
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
||||
} |
||||
void RequestServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) { |
||||
::grpc::Service::RequestAsyncBidiStreaming(0, context, stream, new_call_cq, notification_cq, tag); |
||||
} |
||||
}; |
||||
typedef WithAsyncMethod_ServerReflectionInfo<Service > AsyncService; |
||||
template <class BaseClass> |
||||
class WithGenericMethod_ServerReflectionInfo : public BaseClass { |
||||
private: |
||||
void BaseClassMustBeDerivedFromService(const Service *service) {} |
||||
public: |
||||
WithGenericMethod_ServerReflectionInfo() { |
||||
::grpc::Service::MarkMethodGeneric(0); |
||||
} |
||||
~WithGenericMethod_ServerReflectionInfo() GRPC_OVERRIDE { |
||||
BaseClassMustBeDerivedFromService(this); |
||||
} |
||||
// disable synchronous version of this method
|
||||
::grpc::Status ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) GRPC_FINAL GRPC_OVERRIDE { |
||||
abort(); |
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
||||
} |
||||
}; |
||||
}; |
||||
|
||||
} // namespace v1alpha
|
||||
} // namespace reflection
|
||||
} // namespace grpc
|
||||
|
||||
|
||||
#endif // GRPC_reflection_2eproto__INCLUDED
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,227 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2016, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <unordered_set> |
||||
#include <vector> |
||||
|
||||
#include <grpc++/grpc++.h> |
||||
|
||||
#include "src/cpp/ext/proto_server_reflection.h" |
||||
|
||||
using grpc::Status; |
||||
using grpc::StatusCode; |
||||
using grpc::reflection::v1alpha::ServerReflectionRequest; |
||||
using grpc::reflection::v1alpha::ExtensionRequest; |
||||
using grpc::reflection::v1alpha::ServerReflectionResponse; |
||||
using grpc::reflection::v1alpha::ListServiceResponse; |
||||
using grpc::reflection::v1alpha::ServiceResponse; |
||||
using grpc::reflection::v1alpha::ExtensionNumberResponse; |
||||
using grpc::reflection::v1alpha::ErrorResponse; |
||||
using grpc::reflection::v1alpha::FileDescriptorResponse; |
||||
|
||||
namespace grpc { |
||||
|
||||
ProtoServerReflection::ProtoServerReflection() |
||||
: descriptor_pool_(protobuf::DescriptorPool::generated_pool()) {} |
||||
|
||||
void ProtoServerReflection::SetServiceList( |
||||
const std::vector<grpc::string>* services) { |
||||
services_ = services; |
||||
} |
||||
|
||||
Status ProtoServerReflection::ServerReflectionInfo( |
||||
ServerContext* context, |
||||
ServerReaderWriter<ServerReflectionResponse, ServerReflectionRequest>* |
||||
stream) { |
||||
ServerReflectionRequest request; |
||||
ServerReflectionResponse response; |
||||
Status status; |
||||
while (stream->Read(&request)) { |
||||
switch (request.message_request_case()) { |
||||
case ServerReflectionRequest::MessageRequestCase::kFileByFilename: |
||||
status = GetFileByName(context, request.file_by_filename(), &response); |
||||
break; |
||||
case ServerReflectionRequest::MessageRequestCase::kFileContainingSymbol: |
||||
status = GetFileContainingSymbol( |
||||
context, request.file_containing_symbol(), &response); |
||||
break; |
||||
case ServerReflectionRequest::MessageRequestCase:: |
||||
kFileContainingExtension: |
||||
status = GetFileContainingExtension( |
||||
context, &request.file_containing_extension(), &response); |
||||
break; |
||||
case ServerReflectionRequest::MessageRequestCase:: |
||||
kAllExtensionNumbersOfType: |
||||
status = GetAllExtensionNumbers( |
||||
context, request.all_extension_numbers_of_type(), |
||||
response.mutable_all_extension_numbers_response()); |
||||
break; |
||||
case ServerReflectionRequest::MessageRequestCase::kListServices: |
||||
status = |
||||
ListService(context, response.mutable_list_services_response()); |
||||
break; |
||||
default: |
||||
status = Status(StatusCode::UNIMPLEMENTED, ""); |
||||
} |
||||
|
||||
if (!status.ok()) { |
||||
FillErrorResponse(status, response.mutable_error_response()); |
||||
} |
||||
response.set_valid_host(request.host()); |
||||
response.set_allocated_original_request( |
||||
new ServerReflectionRequest(request)); |
||||
stream->Write(response); |
||||
} |
||||
|
||||
return Status::OK; |
||||
} |
||||
|
||||
void ProtoServerReflection::FillErrorResponse(const Status& status, |
||||
ErrorResponse* error_response) { |
||||
error_response->set_error_code(status.error_code()); |
||||
error_response->set_error_message(status.error_message()); |
||||
} |
||||
|
||||
Status ProtoServerReflection::ListService(ServerContext* context, |
||||
ListServiceResponse* response) { |
||||
if (services_ == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "Services not found."); |
||||
} |
||||
for (auto it = services_->begin(); it != services_->end(); ++it) { |
||||
ServiceResponse* service_response = response->add_service(); |
||||
service_response->set_name(*it); |
||||
} |
||||
return Status::OK; |
||||
} |
||||
|
||||
Status ProtoServerReflection::GetFileByName( |
||||
ServerContext* context, const grpc::string& filename, |
||||
ServerReflectionResponse* response) { |
||||
if (descriptor_pool_ == nullptr) { |
||||
return Status::CANCELLED; |
||||
} |
||||
|
||||
const protobuf::FileDescriptor* file_desc = |
||||
descriptor_pool_->FindFileByName(filename); |
||||
if (file_desc == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "File not found."); |
||||
} |
||||
std::unordered_set<grpc::string> seen_files; |
||||
FillFileDescriptorResponse(file_desc, response, &seen_files); |
||||
return Status::OK; |
||||
} |
||||
|
||||
Status ProtoServerReflection::GetFileContainingSymbol( |
||||
ServerContext* context, const grpc::string& symbol, |
||||
ServerReflectionResponse* response) { |
||||
if (descriptor_pool_ == nullptr) { |
||||
return Status::CANCELLED; |
||||
} |
||||
|
||||
const protobuf::FileDescriptor* file_desc = |
||||
descriptor_pool_->FindFileContainingSymbol(symbol); |
||||
if (file_desc == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "Symbol not found."); |
||||
} |
||||
std::unordered_set<grpc::string> seen_files; |
||||
FillFileDescriptorResponse(file_desc, response, &seen_files); |
||||
return Status::OK; |
||||
} |
||||
|
||||
Status ProtoServerReflection::GetFileContainingExtension( |
||||
ServerContext* context, const ExtensionRequest* request, |
||||
ServerReflectionResponse* response) { |
||||
if (descriptor_pool_ == nullptr) { |
||||
return Status::CANCELLED; |
||||
} |
||||
|
||||
const protobuf::Descriptor* desc = |
||||
descriptor_pool_->FindMessageTypeByName(request->containing_type()); |
||||
if (desc == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "Type not found."); |
||||
} |
||||
|
||||
const protobuf::FieldDescriptor* field_desc = |
||||
descriptor_pool_->FindExtensionByNumber(desc, |
||||
request->extension_number()); |
||||
if (field_desc == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "Extension not found."); |
||||
} |
||||
std::unordered_set<grpc::string> seen_files; |
||||
FillFileDescriptorResponse(field_desc->file(), response, &seen_files); |
||||
return Status::OK; |
||||
} |
||||
|
||||
Status ProtoServerReflection::GetAllExtensionNumbers( |
||||
ServerContext* context, const grpc::string& type, |
||||
ExtensionNumberResponse* response) { |
||||
if (descriptor_pool_ == nullptr) { |
||||
return Status::CANCELLED; |
||||
} |
||||
|
||||
const protobuf::Descriptor* desc = |
||||
descriptor_pool_->FindMessageTypeByName(type); |
||||
if (desc == nullptr) { |
||||
return Status(StatusCode::NOT_FOUND, "Type not found."); |
||||
} |
||||
|
||||
std::vector<const protobuf::FieldDescriptor*> extensions; |
||||
descriptor_pool_->FindAllExtensions(desc, &extensions); |
||||
for (auto extension : extensions) { |
||||
response->add_extension_number(extension->number()); |
||||
} |
||||
response->set_base_type_name(type); |
||||
return Status::OK; |
||||
} |
||||
|
||||
void ProtoServerReflection::FillFileDescriptorResponse( |
||||
const protobuf::FileDescriptor* file_desc, |
||||
ServerReflectionResponse* response, |
||||
std::unordered_set<grpc::string>* seen_files) { |
||||
if (seen_files->find(file_desc->name()) != seen_files->end()) { |
||||
return; |
||||
} |
||||
seen_files->insert(file_desc->name()); |
||||
|
||||
protobuf::FileDescriptorProto file_desc_proto; |
||||
grpc::string data; |
||||
file_desc->CopyTo(&file_desc_proto); |
||||
file_desc_proto.SerializeToString(&data); |
||||
response->mutable_file_descriptor_response()->add_file_descriptor_proto(data); |
||||
|
||||
for (int i = 0; i < file_desc->dependency_count(); ++i) { |
||||
FillFileDescriptorResponse(file_desc->dependency(i), response, seen_files); |
||||
} |
||||
} |
||||
|
||||
} // namespace grpc
|
@ -0,0 +1,94 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
#ifndef GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H |
||||
#define GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H |
||||
|
||||
#include <unordered_set> |
||||
#include <vector> |
||||
|
||||
#include <grpc++/ext/reflection.grpc.pb.h> |
||||
#include <grpc++/grpc++.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
class ProtoServerReflection GRPC_FINAL |
||||
: public reflection::v1alpha::ServerReflection::Service { |
||||
public: |
||||
ProtoServerReflection(); |
||||
|
||||
// Add the full names of registered services
|
||||
void SetServiceList(const std::vector<grpc::string>* services); |
||||
|
||||
// implementation of ServerReflectionInfo(stream ServerReflectionRequest) rpc
|
||||
// in ServerReflection service
|
||||
Status ServerReflectionInfo( |
||||
ServerContext* context, |
||||
ServerReaderWriter<reflection::v1alpha::ServerReflectionResponse, |
||||
reflection::v1alpha::ServerReflectionRequest>* stream) |
||||
GRPC_OVERRIDE; |
||||
|
||||
private: |
||||
Status ListService(ServerContext* context, |
||||
reflection::v1alpha::ListServiceResponse* response); |
||||
|
||||
Status GetFileByName(ServerContext* context, const grpc::string& file_name, |
||||
reflection::v1alpha::ServerReflectionResponse* response); |
||||
|
||||
Status GetFileContainingSymbol( |
||||
ServerContext* context, const grpc::string& symbol, |
||||
reflection::v1alpha::ServerReflectionResponse* response); |
||||
|
||||
Status GetFileContainingExtension( |
||||
ServerContext* context, |
||||
const reflection::v1alpha::ExtensionRequest* request, |
||||
reflection::v1alpha::ServerReflectionResponse* response); |
||||
|
||||
Status GetAllExtensionNumbers( |
||||
ServerContext* context, const grpc::string& type, |
||||
reflection::v1alpha::ExtensionNumberResponse* response); |
||||
|
||||
void FillFileDescriptorResponse( |
||||
const protobuf::FileDescriptor* file_desc, |
||||
reflection::v1alpha::ServerReflectionResponse* response, |
||||
std::unordered_set<grpc::string>* seen_files); |
||||
|
||||
void FillErrorResponse(const Status& status, |
||||
reflection::v1alpha::ErrorResponse* error_response); |
||||
|
||||
const protobuf::DescriptorPool* descriptor_pool_; |
||||
const std::vector<string>* services_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPC_INTERNAL_CPP_EXT_PROTO_SERVER_REFLECTION_H
|
@ -0,0 +1,97 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <grpc++/ext/proto_server_reflection_plugin.h> |
||||
#include <grpc++/impl/server_builder_plugin.h> |
||||
#include <grpc++/impl/server_initializer.h> |
||||
#include <grpc++/server.h> |
||||
|
||||
#include "src/cpp/ext/proto_server_reflection.h" |
||||
|
||||
namespace grpc { |
||||
namespace reflection { |
||||
|
||||
ProtoServerReflectionPlugin::ProtoServerReflectionPlugin() |
||||
: reflection_service_(new grpc::ProtoServerReflection()) {} |
||||
|
||||
grpc::string ProtoServerReflectionPlugin::name() { |
||||
return "proto_server_reflection"; |
||||
} |
||||
|
||||
void ProtoServerReflectionPlugin::InitServer(grpc::ServerInitializer* si) { |
||||
si->RegisterService(reflection_service_); |
||||
} |
||||
|
||||
void ProtoServerReflectionPlugin::Finish(grpc::ServerInitializer* si) { |
||||
reflection_service_->SetServiceList(si->GetServiceList()); |
||||
} |
||||
|
||||
void ProtoServerReflectionPlugin::ChangeArguments(const grpc::string& name, |
||||
void* value) {} |
||||
|
||||
bool ProtoServerReflectionPlugin::has_sync_methods() const { |
||||
if (reflection_service_ != nullptr) { |
||||
return reflection_service_->has_synchronous_methods(); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
bool ProtoServerReflectionPlugin::has_async_methods() const { |
||||
if (reflection_service_ != nullptr) { |
||||
return reflection_service_->has_async_methods(); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
static std::unique_ptr<::grpc::ServerBuilderPlugin> CreateProtoReflection() { |
||||
return std::unique_ptr<::grpc::ServerBuilderPlugin>( |
||||
new ProtoServerReflectionPlugin()); |
||||
} |
||||
|
||||
void InitProtoReflectionServerBuilderPlugin() { |
||||
static bool already_here = false; |
||||
if (already_here) return; |
||||
already_here = true; |
||||
::grpc::ServerBuilder::InternalAddPluginFactory(&CreateProtoReflection); |
||||
} |
||||
|
||||
// Force InitProtoReflectionServerBuilderPlugin() to be called at static
|
||||
// initialization time.
|
||||
struct StaticProtoReflectionPluginInitializer { |
||||
StaticProtoReflectionPluginInitializer() { |
||||
InitProtoReflectionServerBuilderPlugin(); |
||||
} |
||||
} static_proto_reflection_plugin_initializer; |
||||
|
||||
} // namespace reflection
|
||||
} // namespace grpc
|
@ -0,0 +1,97 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2015, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
|
||||
// Generated by the gRPC protobuf plugin.
|
||||
// If you make any local change, they will be lost.
|
||||
// source: reflection.proto
|
||||
|
||||
#include <grpc++/ext/reflection.pb.h> |
||||
#include <grpc++/ext/reflection.grpc.pb.h> |
||||
|
||||
#include <grpc++/impl/codegen/async_stream.h> |
||||
#include <grpc++/impl/codegen/async_unary_call.h> |
||||
#include <grpc++/impl/codegen/channel_interface.h> |
||||
#include <grpc++/impl/codegen/client_unary_call.h> |
||||
#include <grpc++/impl/codegen/method_handler_impl.h> |
||||
#include <grpc++/impl/codegen/rpc_service_method.h> |
||||
#include <grpc++/impl/codegen/service_type.h> |
||||
#include <grpc++/impl/codegen/sync_stream.h> |
||||
namespace grpc { |
||||
namespace reflection { |
||||
namespace v1alpha { |
||||
|
||||
static const char* ServerReflection_method_names[] = { |
||||
"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", |
||||
}; |
||||
|
||||
std::unique_ptr< ServerReflection::Stub> ServerReflection::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) { |
||||
std::unique_ptr< ServerReflection::Stub> stub(new ServerReflection::Stub(channel)); |
||||
return stub; |
||||
} |
||||
|
||||
ServerReflection::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) |
||||
: channel_(channel), rpcmethod_ServerReflectionInfo_(ServerReflection_method_names[0], ::grpc::RpcMethod::BIDI_STREAMING, channel) |
||||
{} |
||||
|
||||
::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflection::Stub::ServerReflectionInfoRaw(::grpc::ClientContext* context) { |
||||
return new ::grpc::ClientReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>(channel_.get(), rpcmethod_ServerReflectionInfo_, context); |
||||
} |
||||
|
||||
::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>* ServerReflection::Stub::AsyncServerReflectionInfoRaw(::grpc::ClientContext* context, ::grpc::CompletionQueue* cq, void* tag) { |
||||
return new ::grpc::ClientAsyncReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>(channel_.get(), cq, rpcmethod_ServerReflectionInfo_, context, tag); |
||||
} |
||||
|
||||
ServerReflection::Service::Service() { |
||||
(void)ServerReflection_method_names; |
||||
AddMethod(new ::grpc::RpcServiceMethod( |
||||
ServerReflection_method_names[0], |
||||
::grpc::RpcMethod::BIDI_STREAMING, |
||||
new ::grpc::BidiStreamingHandler< ServerReflection::Service, ::grpc::reflection::v1alpha::ServerReflectionRequest, ::grpc::reflection::v1alpha::ServerReflectionResponse>( |
||||
std::mem_fn(&ServerReflection::Service::ServerReflectionInfo), this))); |
||||
} |
||||
|
||||
ServerReflection::Service::~Service() { |
||||
} |
||||
|
||||
::grpc::Status ServerReflection::Service::ServerReflectionInfo(::grpc::ServerContext* context, ::grpc::ServerReaderWriter< ::grpc::reflection::v1alpha::ServerReflectionResponse, ::grpc::reflection::v1alpha::ServerReflectionRequest>* stream) { |
||||
(void) context; |
||||
(void) stream; |
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, ""); |
||||
} |
||||
|
||||
|
||||
} // namespace grpc
|
||||
} // namespace reflection
|
||||
} // namespace v1alpha
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,166 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2016, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include <google/protobuf/descriptor.h> |
||||
#include <grpc++/channel.h> |
||||
#include <grpc++/client_context.h> |
||||
#include <grpc++/create_channel.h> |
||||
#include <grpc++/ext/proto_server_reflection_plugin.h> |
||||
#include <grpc++/security/credentials.h> |
||||
#include <grpc++/security/server_credentials.h> |
||||
#include <grpc++/server.h> |
||||
#include <grpc++/server_builder.h> |
||||
#include <grpc++/server_context.h> |
||||
#include <grpc/grpc.h> |
||||
#include <gtest/gtest.h> |
||||
|
||||
#include "src/proto/grpc/testing/echo.grpc.pb.h" |
||||
#include "test/core/util/port.h" |
||||
#include "test/core/util/test_config.h" |
||||
#include "test/cpp/end2end/test_service_impl.h" |
||||
#include "test/cpp/util/proto_reflection_descriptor_database.h" |
||||
|
||||
namespace grpc { |
||||
namespace testing { |
||||
|
||||
class ProtoServerReflectionTest : public ::testing::Test { |
||||
public: |
||||
ProtoServerReflectionTest() {} |
||||
|
||||
void SetUp() GRPC_OVERRIDE { |
||||
port_ = grpc_pick_unused_port_or_die(); |
||||
ref_desc_pool_ = google::protobuf::DescriptorPool::generated_pool(); |
||||
|
||||
ServerBuilder builder; |
||||
grpc::string server_address = "localhost:" + to_string(port_); |
||||
builder.AddListeningPort(server_address, InsecureServerCredentials()); |
||||
server_ = builder.BuildAndStart(); |
||||
} |
||||
|
||||
void ResetStub() { |
||||
string target = "dns:localhost:" + to_string(port_); |
||||
std::shared_ptr<Channel> channel = |
||||
CreateChannel(target, InsecureChannelCredentials()); |
||||
stub_ = grpc::testing::EchoTestService::NewStub(channel); |
||||
desc_db_.reset(new ProtoReflectionDescriptorDatabase(channel)); |
||||
desc_pool_.reset(new google::protobuf::DescriptorPool(desc_db_.get())); |
||||
} |
||||
|
||||
string to_string(const int number) { |
||||
std::stringstream strs; |
||||
strs << number; |
||||
return strs.str(); |
||||
} |
||||
|
||||
void CompareService(const grpc::string& service) { |
||||
const google::protobuf::ServiceDescriptor* service_desc = |
||||
desc_pool_->FindServiceByName(service); |
||||
const google::protobuf::ServiceDescriptor* ref_service_desc = |
||||
ref_desc_pool_->FindServiceByName(service); |
||||
EXPECT_TRUE(service_desc != nullptr); |
||||
EXPECT_TRUE(ref_service_desc != nullptr); |
||||
EXPECT_EQ(service_desc->DebugString(), ref_service_desc->DebugString()); |
||||
|
||||
const google::protobuf::FileDescriptor* file_desc = service_desc->file(); |
||||
if (known_files_.find(file_desc->package() + "/" + file_desc->name()) != |
||||
known_files_.end()) { |
||||
EXPECT_EQ(file_desc->DebugString(), |
||||
ref_service_desc->file()->DebugString()); |
||||
known_files_.insert(file_desc->package() + "/" + file_desc->name()); |
||||
} |
||||
|
||||
for (int i = 0; i < service_desc->method_count(); ++i) { |
||||
CompareMethod(service_desc->method(i)->full_name()); |
||||
} |
||||
} |
||||
|
||||
void CompareMethod(const grpc::string& method) { |
||||
const google::protobuf::MethodDescriptor* method_desc = |
||||
desc_pool_->FindMethodByName(method); |
||||
const google::protobuf::MethodDescriptor* ref_method_desc = |
||||
ref_desc_pool_->FindMethodByName(method); |
||||
EXPECT_TRUE(method_desc != nullptr); |
||||
EXPECT_TRUE(ref_method_desc != nullptr); |
||||
EXPECT_EQ(method_desc->DebugString(), ref_method_desc->DebugString()); |
||||
|
||||
CompareType(method_desc->input_type()->full_name()); |
||||
CompareType(method_desc->output_type()->full_name()); |
||||
} |
||||
|
||||
void CompareType(const grpc::string& type) { |
||||
if (known_types_.find(type) != known_types_.end()) { |
||||
return; |
||||
} |
||||
|
||||
const google::protobuf::Descriptor* desc = |
||||
desc_pool_->FindMessageTypeByName(type); |
||||
const google::protobuf::Descriptor* ref_desc = |
||||
ref_desc_pool_->FindMessageTypeByName(type); |
||||
EXPECT_TRUE(desc != nullptr); |
||||
EXPECT_TRUE(ref_desc != nullptr); |
||||
EXPECT_EQ(desc->DebugString(), ref_desc->DebugString()); |
||||
} |
||||
|
||||
protected: |
||||
std::unique_ptr<Server> server_; |
||||
std::unique_ptr<grpc::testing::EchoTestService::Stub> stub_; |
||||
std::unique_ptr<ProtoReflectionDescriptorDatabase> desc_db_; |
||||
std::unique_ptr<google::protobuf::DescriptorPool> desc_pool_; |
||||
std::unordered_set<string> known_files_; |
||||
std::unordered_set<string> known_types_; |
||||
const google::protobuf::DescriptorPool* ref_desc_pool_; |
||||
int port_; |
||||
reflection::ProtoServerReflectionPlugin plugin_; |
||||
}; |
||||
|
||||
TEST_F(ProtoServerReflectionTest, CheckResponseWithLocalDescriptorPool) { |
||||
ResetStub(); |
||||
|
||||
std::vector<std::string> services; |
||||
desc_db_->GetServices(&services); |
||||
// The service list has at least one service (reflection servcie).
|
||||
EXPECT_TRUE(services.size() > 0); |
||||
|
||||
for (auto it = services.begin(); it != services.end(); ++it) { |
||||
CompareService(*it); |
||||
} |
||||
} |
||||
|
||||
} // namespace testing
|
||||
} // namespace grpc
|
||||
|
||||
int main(int argc, char** argv) { |
||||
grpc_test_init(argc, argv); |
||||
::testing::InitGoogleTest(&argc, argv); |
||||
return RUN_ALL_TESTS(); |
||||
} |
@ -0,0 +1,316 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2016, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
|
||||
#include "test/cpp/util/proto_reflection_descriptor_database.h" |
||||
|
||||
#include <vector> |
||||
|
||||
#include <grpc/support/log.h> |
||||
|
||||
using grpc::reflection::v1alpha::ServerReflection; |
||||
using grpc::reflection::v1alpha::ServerReflectionRequest; |
||||
using grpc::reflection::v1alpha::ServerReflectionResponse; |
||||
using grpc::reflection::v1alpha::ListServiceResponse; |
||||
using grpc::reflection::v1alpha::ErrorResponse; |
||||
|
||||
namespace grpc { |
||||
|
||||
ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase( |
||||
std::unique_ptr<ServerReflection::Stub> stub) |
||||
: stub_(std::move(stub)) {} |
||||
|
||||
ProtoReflectionDescriptorDatabase::ProtoReflectionDescriptorDatabase( |
||||
std::shared_ptr<grpc::Channel> channel) |
||||
: stub_(ServerReflection::NewStub(channel)) {} |
||||
|
||||
ProtoReflectionDescriptorDatabase::~ProtoReflectionDescriptorDatabase() {} |
||||
|
||||
bool ProtoReflectionDescriptorDatabase::FindFileByName( |
||||
const string& filename, google::protobuf::FileDescriptorProto* output) { |
||||
if (cached_db_.FindFileByName(filename, output)) { |
||||
return true; |
||||
} |
||||
|
||||
if (known_files_.find(filename) != known_files_.end()) { |
||||
return false; |
||||
} |
||||
|
||||
ServerReflectionRequest request; |
||||
request.set_file_by_filename(filename); |
||||
ServerReflectionResponse response; |
||||
|
||||
DoOneRequest(request, response); |
||||
|
||||
if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { |
||||
AddFileFromResponse(response.file_descriptor_response()); |
||||
} else if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kErrorResponse) { |
||||
const ErrorResponse error = response.error_response(); |
||||
if (error.error_code() == StatusCode::NOT_FOUND) { |
||||
gpr_log(GPR_INFO, "NOT_FOUND from server for FindFileByName(%s)", |
||||
filename.c_str()); |
||||
} else { |
||||
gpr_log(GPR_INFO, |
||||
"Error on FindFileByName(%s)\n\tError code: %d\n" |
||||
"\tError Message: %s", |
||||
filename.c_str(), error.error_code(), |
||||
error.error_message().c_str()); |
||||
} |
||||
} else { |
||||
gpr_log( |
||||
GPR_INFO, |
||||
"Error on FindFileByName(%s) response type\n" |
||||
"\tExpecting: %d\n\tReceived: %d", |
||||
filename.c_str(), |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, |
||||
response.message_response_case()); |
||||
} |
||||
|
||||
return cached_db_.FindFileByName(filename, output); |
||||
} |
||||
|
||||
bool ProtoReflectionDescriptorDatabase::FindFileContainingSymbol( |
||||
const string& symbol_name, google::protobuf::FileDescriptorProto* output) { |
||||
if (cached_db_.FindFileContainingSymbol(symbol_name, output)) { |
||||
return true; |
||||
} |
||||
|
||||
if (missing_symbols_.find(symbol_name) != missing_symbols_.end()) { |
||||
return false; |
||||
} |
||||
|
||||
ServerReflectionRequest request; |
||||
request.set_file_containing_symbol(symbol_name); |
||||
ServerReflectionResponse response; |
||||
|
||||
DoOneRequest(request, response); |
||||
|
||||
if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { |
||||
AddFileFromResponse(response.file_descriptor_response()); |
||||
} else if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kErrorResponse) { |
||||
const ErrorResponse error = response.error_response(); |
||||
if (error.error_code() == StatusCode::NOT_FOUND) { |
||||
missing_symbols_.insert(symbol_name); |
||||
gpr_log(GPR_INFO, |
||||
"NOT_FOUND from server for FindFileContainingSymbol(%s)", |
||||
symbol_name.c_str()); |
||||
} else { |
||||
gpr_log(GPR_INFO, |
||||
"Error on FindFileContainingSymbol(%s)\n" |
||||
"\tError code: %d\n\tError Message: %s", |
||||
symbol_name.c_str(), error.error_code(), |
||||
error.error_message().c_str()); |
||||
} |
||||
} else { |
||||
gpr_log( |
||||
GPR_INFO, |
||||
"Error on FindFileContainingSymbol(%s) response type\n" |
||||
"\tExpecting: %d\n\tReceived: %d", |
||||
symbol_name.c_str(), |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, |
||||
response.message_response_case()); |
||||
} |
||||
return cached_db_.FindFileContainingSymbol(symbol_name, output); |
||||
} |
||||
|
||||
bool ProtoReflectionDescriptorDatabase::FindFileContainingExtension( |
||||
const string& containing_type, int field_number, |
||||
google::protobuf::FileDescriptorProto* output) { |
||||
if (cached_db_.FindFileContainingExtension(containing_type, field_number, |
||||
output)) { |
||||
return true; |
||||
} |
||||
|
||||
if (missing_extensions_.find(containing_type) != missing_extensions_.end() && |
||||
missing_extensions_[containing_type].find(field_number) != |
||||
missing_extensions_[containing_type].end()) { |
||||
gpr_log(GPR_INFO, "nested map."); |
||||
return false; |
||||
} |
||||
|
||||
ServerReflectionRequest request; |
||||
request.mutable_file_containing_extension()->set_containing_type( |
||||
containing_type); |
||||
request.mutable_file_containing_extension()->set_extension_number( |
||||
field_number); |
||||
ServerReflectionResponse response; |
||||
|
||||
DoOneRequest(request, response); |
||||
|
||||
if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse) { |
||||
AddFileFromResponse(response.file_descriptor_response()); |
||||
} else if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kErrorResponse) { |
||||
const ErrorResponse error = response.error_response(); |
||||
if (error.error_code() == StatusCode::NOT_FOUND) { |
||||
if (missing_extensions_.find(containing_type) == |
||||
missing_extensions_.end()) { |
||||
missing_extensions_[containing_type] = {}; |
||||
} |
||||
missing_extensions_[containing_type].insert(field_number); |
||||
gpr_log(GPR_INFO, |
||||
"NOT_FOUND from server for FindFileContainingExtension(%s, %d)", |
||||
containing_type.c_str(), field_number); |
||||
} else { |
||||
gpr_log(GPR_INFO, |
||||
"Error on FindFileContainingExtension(%s, %d)\n" |
||||
"\tError code: %d\n\tError Message: %s", |
||||
containing_type.c_str(), field_number, error.error_code(), |
||||
error.error_message().c_str()); |
||||
} |
||||
} else { |
||||
gpr_log( |
||||
GPR_INFO, |
||||
"Error on FindFileContainingExtension(%s, %d) response type\n" |
||||
"\tExpecting: %d\n\tReceived: %d", |
||||
containing_type.c_str(), field_number, |
||||
ServerReflectionResponse::MessageResponseCase::kFileDescriptorResponse, |
||||
response.message_response_case()); |
||||
} |
||||
|
||||
return cached_db_.FindFileContainingExtension(containing_type, field_number, |
||||
output); |
||||
} |
||||
|
||||
bool ProtoReflectionDescriptorDatabase::FindAllExtensionNumbers( |
||||
const string& extendee_type, std::vector<int>* output) { |
||||
if (cached_extension_numbers_.find(extendee_type) != |
||||
cached_extension_numbers_.end()) { |
||||
*output = cached_extension_numbers_[extendee_type]; |
||||
return true; |
||||
} |
||||
|
||||
ServerReflectionRequest request; |
||||
request.set_all_extension_numbers_of_type(extendee_type); |
||||
ServerReflectionResponse response; |
||||
|
||||
DoOneRequest(request, response); |
||||
|
||||
if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase:: |
||||
kAllExtensionNumbersResponse) { |
||||
auto number = response.all_extension_numbers_response().extension_number(); |
||||
*output = std::vector<int>(number.begin(), number.end()); |
||||
cached_extension_numbers_[extendee_type] = *output; |
||||
return true; |
||||
} else if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kErrorResponse) { |
||||
const ErrorResponse error = response.error_response(); |
||||
if (error.error_code() == StatusCode::NOT_FOUND) { |
||||
gpr_log(GPR_INFO, "NOT_FOUND from server for FindAllExtensionNumbers(%s)", |
||||
extendee_type.c_str()); |
||||
} else { |
||||
gpr_log(GPR_INFO, |
||||
"Error on FindAllExtensionNumbersExtension(%s)\n" |
||||
"\tError code: %d\n\tError Message: %s", |
||||
extendee_type.c_str(), error.error_code(), |
||||
error.error_message().c_str()); |
||||
} |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
bool ProtoReflectionDescriptorDatabase::GetServices( |
||||
std::vector<std::string>* output) { |
||||
ServerReflectionRequest request; |
||||
request.set_list_services(""); |
||||
ServerReflectionResponse response; |
||||
|
||||
DoOneRequest(request, response); |
||||
|
||||
if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kListServicesResponse) { |
||||
const ListServiceResponse ls_response = response.list_services_response(); |
||||
for (int i = 0; i < ls_response.service_size(); ++i) { |
||||
(*output).push_back(ls_response.service(i).name()); |
||||
} |
||||
return true; |
||||
} else if (response.message_response_case() == |
||||
ServerReflectionResponse::MessageResponseCase::kErrorResponse) { |
||||
const ErrorResponse error = response.error_response(); |
||||
gpr_log(GPR_INFO, |
||||
"Error on GetServices()\n\tError code: %d\n" |
||||
"\tError Message: %s", |
||||
error.error_code(), error.error_message().c_str()); |
||||
} else { |
||||
gpr_log( |
||||
GPR_INFO, |
||||
"Error on GetServices() response type\n\tExpecting: %d\n\tReceived: %d", |
||||
ServerReflectionResponse::MessageResponseCase::kListServicesResponse, |
||||
response.message_response_case()); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
const google::protobuf::FileDescriptorProto |
||||
ProtoReflectionDescriptorDatabase::ParseFileDescriptorProtoResponse( |
||||
const std::string& byte_fd_proto) { |
||||
google::protobuf::FileDescriptorProto file_desc_proto; |
||||
file_desc_proto.ParseFromString(byte_fd_proto); |
||||
return file_desc_proto; |
||||
} |
||||
|
||||
void ProtoReflectionDescriptorDatabase::AddFileFromResponse( |
||||
const grpc::reflection::v1alpha::FileDescriptorResponse& response) { |
||||
for (int i = 0; i < response.file_descriptor_proto_size(); ++i) { |
||||
const google::protobuf::FileDescriptorProto file_proto = |
||||
ParseFileDescriptorProtoResponse(response.file_descriptor_proto(i)); |
||||
if (known_files_.find(file_proto.name()) == known_files_.end()) { |
||||
known_files_.insert(file_proto.name()); |
||||
cached_db_.Add(file_proto); |
||||
} |
||||
} |
||||
} |
||||
|
||||
const std::shared_ptr<ProtoReflectionDescriptorDatabase::ClientStream> |
||||
ProtoReflectionDescriptorDatabase::GetStream() { |
||||
if (stream_ == nullptr) { |
||||
stream_ = stub_->ServerReflectionInfo(&ctx_); |
||||
} |
||||
return stream_; |
||||
} |
||||
|
||||
void ProtoReflectionDescriptorDatabase::DoOneRequest( |
||||
const ServerReflectionRequest& request, |
||||
ServerReflectionResponse& response) { |
||||
stream_mutex_.lock(); |
||||
GetStream()->Write(request); |
||||
GetStream()->Read(&response); |
||||
stream_mutex_.unlock(); |
||||
} |
||||
|
||||
} // namespace grpc
|
@ -0,0 +1,131 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2016, Google Inc. |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are |
||||
* met: |
||||
* |
||||
* * Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* * Redistributions in binary form must reproduce the above |
||||
* copyright notice, this list of conditions and the following disclaimer |
||||
* in the documentation and/or other materials provided with the |
||||
* distribution. |
||||
* * Neither the name of Google Inc. nor the names of its |
||||
* contributors may be used to endorse or promote products derived from |
||||
* this software without specific prior written permission. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
* |
||||
*/ |
||||
#ifndef GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H |
||||
#define GRPC_TEST_CPP_PROTO_SERVER_REFLECTION_DATABSE_H |
||||
|
||||
#include <mutex> |
||||
#include <unordered_map> |
||||
#include <unordered_set> |
||||
#include <vector> |
||||
|
||||
#include <google/protobuf/descriptor.h> |
||||
#include <google/protobuf/descriptor.pb.h> |
||||
#include <google/protobuf/descriptor_database.h> |
||||
#include <grpc++/ext/reflection.grpc.pb.h> |
||||
#include <grpc++/grpc++.h> |
||||
|
||||
namespace grpc { |
||||
|
||||
// ProtoReflectionDescriptorDatabase takes a stub of ServerReflection and
|
||||
// provides the methods defined by DescriptorDatabase interfaces. It can be used
|
||||
// to feed a DescriptorPool instance.
|
||||
class ProtoReflectionDescriptorDatabase |
||||
: public google::protobuf::DescriptorDatabase { |
||||
public: |
||||
explicit ProtoReflectionDescriptorDatabase( |
||||
std::unique_ptr<reflection::v1alpha::ServerReflection::Stub> stub); |
||||
|
||||
explicit ProtoReflectionDescriptorDatabase( |
||||
std::shared_ptr<grpc::Channel> channel); |
||||
|
||||
virtual ~ProtoReflectionDescriptorDatabase(); |
||||
|
||||
// The following four methods implement DescriptorDatabase interfaces.
|
||||
//
|
||||
// Find a file by file name. Fills in in *output and returns true if found.
|
||||
// Otherwise, returns false, leaving the contents of *output undefined.
|
||||
bool FindFileByName(const string& filename, |
||||
google::protobuf::FileDescriptorProto* output) |
||||
GRPC_OVERRIDE; |
||||
|
||||
// Find the file that declares the given fully-qualified symbol name.
|
||||
// If found, fills in *output and returns true, otherwise returns false
|
||||
// and leaves *output undefined.
|
||||
bool FindFileContainingSymbol(const string& symbol_name, |
||||
google::protobuf::FileDescriptorProto* output) |
||||
GRPC_OVERRIDE; |
||||
|
||||
// Find the file which defines an extension extending the given message type
|
||||
// with the given field number. If found, fills in *output and returns true,
|
||||
// otherwise returns false and leaves *output undefined. containing_type
|
||||
// must be a fully-qualified type name.
|
||||
bool FindFileContainingExtension( |
||||
const string& containing_type, int field_number, |
||||
google::protobuf::FileDescriptorProto* output) GRPC_OVERRIDE; |
||||
|
||||
// Finds the tag numbers used by all known extensions of
|
||||
// extendee_type, and appends them to output in an undefined
|
||||
// order. This method is best-effort: it's not guaranteed that the
|
||||
// database will find all extensions, and it's not guaranteed that
|
||||
// FindFileContainingExtension will return true on all of the found
|
||||
// numbers. Returns true if the search was successful, otherwise
|
||||
// returns false and leaves output unchanged.
|
||||
bool FindAllExtensionNumbers(const string& extendee_type, |
||||
std::vector<int>* output) GRPC_OVERRIDE; |
||||
|
||||
// Provide a list of full names of registered services
|
||||
bool GetServices(std::vector<std::string>* output); |
||||
|
||||
private: |
||||
typedef ClientReaderWriter< |
||||
grpc::reflection::v1alpha::ServerReflectionRequest, |
||||
grpc::reflection::v1alpha::ServerReflectionResponse> |
||||
ClientStream; |
||||
|
||||
const google::protobuf::FileDescriptorProto ParseFileDescriptorProtoResponse( |
||||
const std::string& byte_fd_proto); |
||||
|
||||
void AddFileFromResponse( |
||||
const grpc::reflection::v1alpha::FileDescriptorResponse& response); |
||||
|
||||
const std::shared_ptr<ClientStream> GetStream(); |
||||
|
||||
void DoOneRequest( |
||||
const grpc::reflection::v1alpha::ServerReflectionRequest& request, |
||||
grpc::reflection::v1alpha::ServerReflectionResponse& response); |
||||
|
||||
std::shared_ptr<ClientStream> stream_; |
||||
grpc::ClientContext ctx_; |
||||
std::unique_ptr<grpc::reflection::v1alpha::ServerReflection::Stub> stub_; |
||||
std::unordered_set<string> known_files_; |
||||
std::unordered_set<string> missing_symbols_; |
||||
std::unordered_map<string, std::unordered_set<int>> missing_extensions_; |
||||
std::unordered_map<string, std::vector<int>> cached_extension_numbers_; |
||||
std::mutex stream_mutex_; |
||||
|
||||
google::protobuf::SimpleDescriptorDatabase cached_db_; |
||||
}; |
||||
|
||||
} // namespace grpc
|
||||
|
||||
#endif // GRPC_TEST_CPP_METRICS_SERVER_H
|
@ -0,0 +1,73 @@ |
||||
#!/bin/bash |
||||
|
||||
# Copyright 2016, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
PROTO_DIR="src/proto/grpc/reflection/v1alpha" |
||||
PROTO_FILE="reflection" |
||||
HEADER_DIR="include/grpc++/ext" |
||||
SRC_DIR="src/cpp/ext" |
||||
INCLUDE_DIR="grpc++/ext" |
||||
TMP_DIR="tmp" |
||||
GRPC_PLUGIN="bins/opt/grpc_cpp_plugin" |
||||
PROTOC=third_party/protobuf/src/protoc |
||||
|
||||
set -e |
||||
|
||||
TMP_DIR=${TMP_DIR}_${PROTO_FILE} |
||||
|
||||
cd $(dirname $0)/../../.. |
||||
|
||||
[ ! -d $HEADER_DIR ] && mkdir -p $HEADER_DIR || : |
||||
[ ! -d $SRC_DIR ] && mkdir -p $SRC_DIR || : |
||||
[ ! -d $TMP_DIR ] && mkdir -p $TMP_DIR || : |
||||
|
||||
$PROTOC -I$PROTO_DIR --cpp_out=$TMP_DIR ${PROTO_DIR}/${PROTO_FILE}.proto |
||||
$PROTOC -I$PROTO_DIR --grpc_out=$TMP_DIR --plugin=protoc-gen-grpc=${GRPC_PLUGIN} ${PROTO_DIR}/${PROTO_FILE}.proto |
||||
|
||||
sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.pb.cc |
||||
sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.h |
||||
sed -i "s/\"${PROTO_FILE}.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc |
||||
sed -i "s/\"${PROTO_FILE}.grpc.pb.h\"/<${INCLUDE_DIR/\//\\\/}\/${PROTO_FILE}.grpc.pb.h>/g" ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc |
||||
|
||||
/bin/cp LICENSE ${TMP_DIR}/TMP_LICENSE |
||||
sed -i -e "s/./ &/" -e "s/.*/ \*&/" ${TMP_DIR}/TMP_LICENSE |
||||
sed -i -r "\$a\ *\n *\/\n\n" ${TMP_DIR}/TMP_LICENSE |
||||
|
||||
sed -i -e "1s/^/ *\n/" -e "1s/^/\/*\n/" ${TMP_DIR}/*.pb.h |
||||
sed -i -e "1s/^/ *\n/" -e "1s/^/\/*\n/" ${TMP_DIR}/*.pb.cc |
||||
|
||||
sed -i "2r ${TMP_DIR}/TMP_LICENSE" ${TMP_DIR}/*.pb.h |
||||
sed -i "2r ${TMP_DIR}/TMP_LICENSE" ${TMP_DIR}/*.pb.cc |
||||
|
||||
/bin/mv ${TMP_DIR}/${PROTO_FILE}.pb.h ${HEADER_DIR} |
||||
/bin/mv ${TMP_DIR}/${PROTO_FILE}.grpc.pb.h ${HEADER_DIR} |
||||
/bin/mv ${TMP_DIR}/${PROTO_FILE}.pb.cc ${SRC_DIR} |
||||
/bin/mv ${TMP_DIR}/${PROTO_FILE}.grpc.pb.cc ${SRC_DIR} |
||||
/bin/rm -r $TMP_DIR |
@ -0,0 +1,40 @@ |
||||
#!/bin/bash |
||||
# Copyright 2016, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
set -ex |
||||
|
||||
# change to root directory |
||||
cd $(dirname $0)/../.. |
||||
|
||||
# build grpc_check_generated_pb_files docker image |
||||
docker build -t grpc_check_generated_pb_files tools/dockerfile/grpc_check_generated_pb_files |
||||
|
||||
# run check_pb_files against the checked out codebase |
||||
docker run -e TEST=$TEST --rm=true -v ${HOST_GIT_ROOT:-`pwd`}:/var/local/jenkins/grpc -t grpc_check_generated_pb_files /var/local/jenkins/grpc/tools/dockerfile/grpc_check_generated_pb_files/check_pb_files.sh |
@ -0,0 +1,78 @@ |
||||
# Copyright 2015, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
FROM debian:jessie |
||||
|
||||
# Install Git and basic packages. |
||||
RUN apt-get update && apt-get install -y \ |
||||
autoconf \ |
||||
autotools-dev \ |
||||
build-essential \ |
||||
bzip2 \ |
||||
ccache \ |
||||
curl \ |
||||
gcc \ |
||||
gcc-multilib \ |
||||
git \ |
||||
golang \ |
||||
gyp \ |
||||
lcov \ |
||||
libc6 \ |
||||
libc6-dbg \ |
||||
libc6-dev \ |
||||
libgtest-dev \ |
||||
libtool \ |
||||
make \ |
||||
perl \ |
||||
strace \ |
||||
python-dev \ |
||||
python-setuptools \ |
||||
python-yaml \ |
||||
telnet \ |
||||
unzip \ |
||||
wget \ |
||||
zip && apt-get clean |
||||
|
||||
#================ |
||||
# Build profiling |
||||
RUN apt-get update && apt-get install -y time && apt-get clean |
||||
|
||||
#================= |
||||
# C++ dependencies |
||||
RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean |
||||
|
||||
#====================== |
||||
# Zookeeper dependencies |
||||
# TODO(jtattermusch): is zookeeper still needed? |
||||
RUN apt-get install -y libzookeeper-mt-dev |
||||
|
||||
RUN mkdir /var/local/jenkins |
||||
|
||||
# Define the default command. |
||||
CMD ["bash"] |
@ -0,0 +1,46 @@ |
||||
#!/bin/bash |
||||
# Copyright 2015, Google Inc. |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions are |
||||
# met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# * Redistributions in binary form must reproduce the above |
||||
# copyright notice, this list of conditions and the following disclaimer |
||||
# in the documentation and/or other materials provided with the |
||||
# distribution. |
||||
# * Neither the name of Google Inc. nor the names of its |
||||
# contributors may be used to endorse or promote products derived from |
||||
# this software without specific prior written permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
set -e |
||||
|
||||
mkdir -p /var/local/git |
||||
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc |
||||
|
||||
cd /var/local/git/grpc |
||||
|
||||
# build grpc cpp plugin for generating grpc pb files |
||||
make grpc_cpp_plugin |
||||
|
||||
# generate pb files |
||||
tools/codegen/extensions/gen_reflection_proto.sh |
||||
|
||||
# check if the pb files in the checked out codebase are identical with the newly |
||||
# generated ones |
||||
git diff --exit-code |
@ -0,0 +1,234 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup Label="ProjectConfigurations"> |
||||
<ProjectConfiguration Include="Debug|Win32"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Debug|x64"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|Win32"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|x64"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
</ItemGroup> |
||||
<PropertyGroup Label="Globals"> |
||||
<ProjectGuid>{5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}</ProjectGuid> |
||||
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> |
||||
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> |
||||
<PlatformToolset>v100</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> |
||||
<PlatformToolset>v110</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> |
||||
<PlatformToolset>v120</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> |
||||
<PlatformToolset>v140</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> |
||||
<ConfigurationType>StaticLibrary</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> |
||||
<ConfigurationType>StaticLibrary</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<WholeProgramOptimization>true</WholeProgramOptimization> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
||||
<ImportGroup Label="ExtensionSettings"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\global.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> |
||||
</ImportGroup> |
||||
<PropertyGroup Label="UserMacros" /> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> |
||||
<TargetName>grpc++_reflection</TargetName> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
||||
<TargetName>grpc++_reflection</TargetName> |
||||
</PropertyGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Windows</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Windows</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Windows</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Windows</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\proto_server_reflection_plugin.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.grpc.pb.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.pb.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\proto_utils.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_stream.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_unary_call.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call_hook.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\channel_interface.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_context.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_unary_call.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue_tag.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_service_method.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\security\auth_context.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\serialization_traits.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_context.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_interface.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\service_type.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status_code_enum.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\string_ref.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\stub_options.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_cxx11.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_no_cxx11.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_stream.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\time.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer_reader.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\compression_types.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\connectivity_state.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\grpc_types.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\propagation_bits.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\status.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\alloc.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_atomic.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_sync.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_windows.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\log.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\port_platform.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice_buffer.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_generic.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_posix.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_windows.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\time.h" /> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config_protobuf.h" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.h" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.cc"> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection_plugin.cc"> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.grpc.pb.cc"> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.pb.cc"> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> |
||||
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
||||
<ImportGroup Label="ExtensionTargets"> |
||||
</ImportGroup> |
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
||||
<PropertyGroup> |
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
||||
</PropertyGroup> |
||||
</Target> |
||||
</Project> |
||||
|
@ -0,0 +1,232 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.cc"> |
||||
<Filter>src\cpp\ext</Filter> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection_plugin.cc"> |
||||
<Filter>src\cpp\ext</Filter> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.grpc.pb.cc"> |
||||
<Filter>src\cpp\ext</Filter> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\src\cpp\ext\reflection.pb.cc"> |
||||
<Filter>src\cpp\ext</Filter> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\proto_server_reflection_plugin.h"> |
||||
<Filter>include\grpc++\ext</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.grpc.pb.h"> |
||||
<Filter>include\grpc++\ext</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\ext\reflection.pb.h"> |
||||
<Filter>include\grpc++\ext</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\proto_utils.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_stream.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\async_unary_call.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\call_hook.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\channel_interface.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_context.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\client_unary_call.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\completion_queue_tag.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\core_codegen_interface.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\create_auth_context.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\grpc_library.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\method_handler_impl.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_method.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\rpc_service_method.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\security\auth_context.h"> |
||||
<Filter>include\grpc++\impl\codegen\security</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\serialization_traits.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_context.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\server_interface.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\service_type.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\status_code_enum.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\string_ref.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\stub_options.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_cxx11.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_no_cxx11.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\sync_stream.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\time.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\byte_buffer_reader.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\compression_types.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\connectivity_state.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\grpc_types.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\propagation_bits.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\status.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\alloc.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_atomic.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_gcc_sync.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\atm_windows.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\log.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\port_platform.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\slice_buffer.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_generic.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_posix.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\sync_windows.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc\impl\codegen\time.h"> |
||||
<Filter>include\grpc\impl\codegen</Filter> |
||||
</ClInclude> |
||||
<ClInclude Include="$(SolutionDir)\..\include\grpc++\impl\codegen\config_protobuf.h"> |
||||
<Filter>include\grpc++\impl\codegen</Filter> |
||||
</ClInclude> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\src\cpp\ext\proto_server_reflection.h"> |
||||
<Filter>src\cpp\ext</Filter> |
||||
</ClInclude> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Filter Include="include"> |
||||
<UniqueIdentifier>{e9441021-f78a-ec84-7efd-1883975feddb}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc"> |
||||
<UniqueIdentifier>{3b19b259-3bf4-c0fa-8e20-ed79acd63ac3}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc++"> |
||||
<UniqueIdentifier>{c66e66b4-a64e-79bf-40e8-1a1bac124a3d}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc++\ext"> |
||||
<UniqueIdentifier>{8d96203b-d3ce-2164-74a6-06e0ff2b09af}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc++\impl"> |
||||
<UniqueIdentifier>{4e57d72c-762f-20b1-bdb9-bc7088ca6fda}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc++\impl\codegen"> |
||||
<UniqueIdentifier>{0f0f3943-7a9d-2b03-7eb1-2fbad4199428}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc++\impl\codegen\security"> |
||||
<UniqueIdentifier>{e1b8bc6d-2cd2-1283-868a-dfd64c3dbab8}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc\impl"> |
||||
<UniqueIdentifier>{7bccc379-84fb-c1aa-19aa-a0cc09ac59ac}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="include\grpc\impl\codegen"> |
||||
<UniqueIdentifier>{a1f1904b-e820-dd3c-b4b0-14a6e0ff9d19}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="src"> |
||||
<UniqueIdentifier>{5ec5476e-3d72-e3f9-4f05-3f7c31c13651}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="src\cpp"> |
||||
<UniqueIdentifier>{a642ac8e-cec2-35d3-9a8a-78313d03b440}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="src\cpp\ext"> |
||||
<UniqueIdentifier>{d0204618-0f6a-dbc6-cf41-ffc04e76075a}</UniqueIdentifier> |
||||
</Filter> |
||||
</ItemGroup> |
||||
</Project> |
||||
|
@ -0,0 +1,215 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\1.0.204.1.props')" /> |
||||
<ItemGroup Label="ProjectConfigurations"> |
||||
<ProjectConfiguration Include="Debug|Win32"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Debug|x64"> |
||||
<Configuration>Debug</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|Win32"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>Win32</Platform> |
||||
</ProjectConfiguration> |
||||
<ProjectConfiguration Include="Release|x64"> |
||||
<Configuration>Release</Configuration> |
||||
<Platform>x64</Platform> |
||||
</ProjectConfiguration> |
||||
</ItemGroup> |
||||
<PropertyGroup Label="Globals"> |
||||
<ProjectGuid>{1881E6A1-EAD4-A68C-9727-FF1956B66185}</ProjectGuid> |
||||
<IgnoreWarnIntDirInTempDetected>true</IgnoreWarnIntDirInTempDetected> |
||||
<IntDir>$(SolutionDir)IntDir\$(MSBuildProjectName)\</IntDir> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0'" Label="Configuration"> |
||||
<PlatformToolset>v100</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0'" Label="Configuration"> |
||||
<PlatformToolset>v110</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '12.0'" Label="Configuration"> |
||||
<PlatformToolset>v120</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(VisualStudioVersion)' == '14.0'" Label="Configuration"> |
||||
<PlatformToolset>v140</PlatformToolset> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>true</UseDebugLibraries> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> |
||||
<ConfigurationType>Application</ConfigurationType> |
||||
<UseDebugLibraries>false</UseDebugLibraries> |
||||
<WholeProgramOptimization>true</WholeProgramOptimization> |
||||
<CharacterSet>Unicode</CharacterSet> |
||||
</PropertyGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
||||
<ImportGroup Label="ExtensionSettings"> |
||||
</ImportGroup> |
||||
<ImportGroup Label="PropertySheets"> |
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\cpptest.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\global.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\openssl.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\protobuf.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\winsock.props" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\zlib.props" /> |
||||
</ImportGroup> |
||||
<PropertyGroup Label="UserMacros" /> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> |
||||
<TargetName>proto_server_reflection_test</TargetName> |
||||
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> |
||||
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> |
||||
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'"> |
||||
<TargetName>proto_server_reflection_test</TargetName> |
||||
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> |
||||
<Configuration-grpc_dependencies_zlib>Release</Configuration-grpc_dependencies_zlib> |
||||
<Linkage-grpc_dependencies_openssl>static</Linkage-grpc_dependencies_openssl> |
||||
<Configuration-grpc_dependencies_openssl>Release</Configuration-grpc_dependencies_openssl> |
||||
</PropertyGroup> |
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>Disabled</Optimization> |
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
||||
<ClCompile> |
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader> |
||||
<WarningLevel>Level3</WarningLevel> |
||||
<Optimization>MaxSpeed</Optimization> |
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
||||
<FunctionLevelLinking>true</FunctionLevelLinking> |
||||
<IntrinsicFunctions>true</IntrinsicFunctions> |
||||
<SDLCheck>true</SDLCheck> |
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> |
||||
<TreatWarningAsError>true</TreatWarningAsError> |
||||
<DebugInformationFormat Condition="$(Jenkins)">None</DebugInformationFormat> |
||||
<MinimalRebuild Condition="$(Jenkins)">false</MinimalRebuild> |
||||
</ClCompile> |
||||
<Link> |
||||
<SubSystem>Console</SubSystem> |
||||
<GenerateDebugInformation Condition="!$(Jenkins)">true</GenerateDebugInformation> |
||||
<GenerateDebugInformation Condition="$(Jenkins)">false</GenerateDebugInformation> |
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding> |
||||
<OptimizeReferences>true</OptimizeReferences> |
||||
</Link> |
||||
</ItemDefinitionGroup> |
||||
|
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.h" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClCompile Include="$(SolutionDir)\..\test\cpp\end2end\proto_server_reflection_test.cc"> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.cc"> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_reflection\grpc++_reflection.vcxproj"> |
||||
<Project>{5F575402-3F89-5D1A-6910-9DB8BF5D2BAB}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++_test_util\grpc++_test_util.vcxproj"> |
||||
<Project>{0BE77741-552A-929B-A497-4EF7ECE17A64}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc_test_util\grpc_test_util.vcxproj"> |
||||
<Project>{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc++\grpc++.vcxproj"> |
||||
<Project>{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\grpc\grpc.vcxproj"> |
||||
<Project>{29D16885-7228-4C31-81ED-5F9187C7F2A9}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr_test_util\gpr_test_util.vcxproj"> |
||||
<Project>{EAB0A629-17A9-44DB-B5FF-E91A721FE037}</Project> |
||||
</ProjectReference> |
||||
<ProjectReference Include="$(SolutionDir)\..\vsprojects\vcxproj\.\gpr\gpr.vcxproj"> |
||||
<Project>{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}</Project> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="packages.config" /> |
||||
</ItemGroup> |
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
||||
<ImportGroup Label="ExtensionTargets"> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies\grpc.dependencies.zlib.targets')" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> |
||||
<Import Project="$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets" Condition="Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies\grpc.dependencies.openssl.targets')" /> |
||||
</ImportGroup> |
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> |
||||
<PropertyGroup> |
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
||||
</PropertyGroup> |
||||
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.redist.1.2.8.10\build\native\grpc.dependencies.zlib.redist.targets')" /> |
||||
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.zlib.1.2.8.10\build\native\grpc.dependencies.zlib.targets')" /> |
||||
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.redist.1.0.204.1\build\native\grpc.dependencies.openssl.redist.targets')" /> |
||||
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.props')" /> |
||||
<Error Condition="!Exists('$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\..\vsprojects\packages\grpc.dependencies.openssl.1.0.204.1\build\native\grpc.dependencies.openssl.targets')" /> |
||||
</Target> |
||||
</Project> |
||||
|
@ -0,0 +1,32 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<ItemGroup> |
||||
<ClCompile Include="$(SolutionDir)\..\test\cpp\end2end\proto_server_reflection_test.cc"> |
||||
<Filter>test\cpp\end2end</Filter> |
||||
</ClCompile> |
||||
<ClCompile Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.cc"> |
||||
<Filter>test\cpp\util</Filter> |
||||
</ClCompile> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ClInclude Include="$(SolutionDir)\..\test\cpp\util\proto_reflection_descriptor_database.h"> |
||||
<Filter>test\cpp\util</Filter> |
||||
</ClInclude> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Filter Include="test"> |
||||
<UniqueIdentifier>{354831a1-52fb-6364-b568-c8c49bfb8d29}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\cpp"> |
||||
<UniqueIdentifier>{b4d957ef-f9fd-2a14-078c-b72f80096f70}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\cpp\end2end"> |
||||
<UniqueIdentifier>{130f224c-89a5-54ea-7045-b54b4188c52b}</UniqueIdentifier> |
||||
</Filter> |
||||
<Filter Include="test\cpp\util"> |
||||
<UniqueIdentifier>{aae81aad-5563-fceb-1461-10fdec84c5b0}</UniqueIdentifier> |
||||
</Filter> |
||||
</ItemGroup> |
||||
</Project> |
||||
|
Loading…
Reference in new issue