Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added version macros to gRPC C++ #31033

Merged
merged 1 commit into from Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions BUILD
Expand Up @@ -361,6 +361,7 @@ GRPCXX_PUBLIC_HDRS = [
"include/grpcpp/server_builder.h",
"include/grpcpp/server_context.h",
"include/grpcpp/server_posix.h",
"include/grpcpp/version_info.h",
"include/grpcpp/support/async_stream.h",
"include/grpcpp/support/async_unary_call.h",
"include/grpcpp/support/byte_buffer.h",
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions build_autogenerated.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions gRPC-C++.podspec

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions include/grpcpp/grpcpp.h
Expand Up @@ -58,6 +58,7 @@
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
#include <grpcpp/server_posix.h>
#include <grpcpp/version_info.h>
// IWYU pragma: end_exports

namespace grpc {
Expand Down
27 changes: 27 additions & 0 deletions include/grpcpp/version_info.h
@@ -0,0 +1,27 @@
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* This file is autogenerated from:
templates/include/grpcpp/version_info.h.template */

#ifndef GRPCPP_VERSION_INFO_H
#define GRPCPP_VERSION_INFO_H

#define GRPC_CPP_VERSION_MAJOR 1
#define GRPC_CPP_VERSION_MINOR 51
#define GRPC_CPP_VERSION_PATCH 0
#define GRPC_CPP_VERSION_TAG "dev"
#define GRPC_CPP_VERSION_STRING "1.51.0-dev"

#endif // GRPCPP_VERSION_INFO_H
5 changes: 1 addition & 4 deletions src/cpp/common/version_cc.cc
Expand Up @@ -16,14 +16,11 @@
*
*/

/* This file is autogenerated from:
templates/src/cpp/common/version_cc.cc.template */

#include <string>

#include <grpcpp/grpcpp.h>
#include <grpcpp/support/config.h>

namespace grpc {
std::string Version() { return "1.51.0-dev"; }
std::string Version() { return GRPC_CPP_VERSION_STRING; }
} // namespace grpc
29 changes: 29 additions & 0 deletions templates/include/grpcpp/version_info.h.template
@@ -0,0 +1,29 @@
%YAML 1.2
--- |
// Copyright 2022 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* This file is autogenerated from:
templates/include/grpcpp/version_info.h.template */

#ifndef GRPCPP_VERSION_INFO_H
#define GRPCPP_VERSION_INFO_H

#define GRPC_CPP_VERSION_MAJOR ${settings.cpp_version.major}
#define GRPC_CPP_VERSION_MINOR ${settings.cpp_version.minor}
#define GRPC_CPP_VERSION_PATCH ${settings.cpp_version.patch}
#define GRPC_CPP_VERSION_TAG "${settings.cpp_version.tag or ''}"
#define GRPC_CPP_VERSION_STRING "${settings.cpp_version}"

#endif // GRPCPP_VERSION_INFO_H
31 changes: 0 additions & 31 deletions templates/src/cpp/common/version_cc.cc.template

This file was deleted.

1 change: 1 addition & 0 deletions tools/doxygen/Doxyfile.c++
Expand Up @@ -1056,6 +1056,7 @@ include/grpcpp/support/stub_options.h \
include/grpcpp/support/sync_stream.h \
include/grpcpp/support/time.h \
include/grpcpp/support/validate_service_config.h \
include/grpcpp/version_info.h \
include/grpcpp/xds_server_builder.h

# This tag can be used to specify the character encoding of the source files
Expand Down
1 change: 1 addition & 0 deletions tools/doxygen/Doxyfile.c++.internal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.