Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion google/cloud/bigquery/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ add_library(
read_stream.h
row.h
row_set.h
version.cc
version.h
version_info.h)
target_include_directories(
Expand Down
1 change: 0 additions & 1 deletion google/cloud/bigquery/bigquery_client.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,4 @@ bigquery_client_srcs = [
"internal/storage_stub.cc",
"internal/streaming_read_result_source.cc",
"read_stream.cc",
"version.cc",
]
7 changes: 5 additions & 2 deletions google/cloud/bigquery/connection_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "google/cloud/bigquery/connection_options.h"
#include "google/cloud/bigquery/version.h"
#include "google/cloud/internal/compiler_info.h"
#include <grpcpp/grpcpp.h>
#include <memory>
#include <string>
Expand All @@ -24,8 +25,10 @@ namespace bigquery {
inline namespace BIGQUERY_CLIENT_NS {
namespace internal {
std::string BaseUserAgentPrefix() {
// TODO(aryann): Add more info here.
return "gcloud-cpp/" + VersionString();
return "gcloud-cpp/" + google::cloud::version_string() + " (" +
::google::cloud::internal::CompilerId() + "-" +
::google::cloud::internal::CompilerVersion() + "; " +
::google::cloud::internal::CompilerFeatures() + ")";
}
} // namespace internal

Expand Down
26 changes: 0 additions & 26 deletions google/cloud/bigquery/version.cc

This file was deleted.

22 changes: 1 addition & 21 deletions google/cloud/bigquery/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,7 @@ namespace bigquery {
// applications can use `bigquery::Foo` in their source, but the
// symbols are versioned, e.g., the symbol becomes
// `bigquery::v1::Foo`.
inline namespace BIGQUERY_CLIENT_NS {
int constexpr VersionMajor() { return BIGQUERY_CLIENT_VERSION_MAJOR; }
int constexpr VersionMinor() { return BIGQUERY_CLIENT_VERSION_MINOR; }
int constexpr VersionPatch() { return BIGQUERY_CLIENT_VERSION_PATCH; }

// Returns a single integer representing the major, minor, and patch
// version.
int constexpr Version() {
static_assert(::google::cloud::version_major() == VersionMajor(),
"Mismatched major version");
static_assert(::google::cloud::version_minor() == VersionMinor(),
"Mismatched minor version");
static_assert(::google::cloud::version_patch() == VersionPatch(),
"Mismatched patch version");
return ::google::cloud::version();
}

// Returns the version as a string in the form `MAJOR.MINOR.PATCH`.
std::string VersionString();

} // namespace BIGQUERY_CLIENT_NS
inline namespace BIGQUERY_CLIENT_NS {} // namespace BIGQUERY_CLIENT_NS
} // namespace bigquery
} // namespace cloud
} // namespace google
Expand Down
1 change: 0 additions & 1 deletion google/cloud/pubsub/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ add_library(
subscription.h
topic.cc
topic.h
version.cc
version.h
version_info.h)
target_include_directories(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) try {
}

std::cout << "Cloud Pub/Sub C++ Client version: "
<< google::cloud::pubsub::VersionString() << "\n";
<< google::cloud::version_string() << "\n";

auto publisher = google::cloud::pubsub::PublisherClient(
google::cloud::pubsub::MakePublisherConnection());
Expand Down
14 changes: 12 additions & 2 deletions google/cloud/pubsub/internal/user_agent_prefix.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Copyright 2020 Google LLC
//
// Created by coryan on 2/6/20.
// 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.

#include "google/cloud/pubsub/internal/user_agent_prefix.h"
#include "google/cloud/internal/compiler_info.h"
Expand All @@ -11,7 +21,7 @@ namespace pubsub_internal {
inline namespace GOOGLE_CLOUD_CPP_PUBSUB_NS {

std::string UserAgentPrefix() {
return "gcloud-cpp/" + google::cloud::pubsub::VersionString() + " (" +
return "gcloud-cpp/" + ::google::cloud::version_string() + " (" +
::google::cloud::internal::CompilerId() + "-" +
::google::cloud::internal::CompilerVersion() + "; " +
::google::cloud::internal::CompilerFeatures() + ")";
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/pubsub/internal/user_agent_prefix_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using ::testing::StartsWith;
TEST(UserAgentPrefix, Format) {
auto const actual = UserAgentPrefix();
EXPECT_THAT(actual, StartsWith("gcloud-cpp/"));
EXPECT_THAT(actual, HasSubstr(pubsub::VersionString()));
EXPECT_THAT(actual, HasSubstr(::google::cloud::version_string()));
EXPECT_THAT(actual, HasSubstr(::google::cloud::internal::CompilerId()));
}

Expand Down
1 change: 0 additions & 1 deletion google/cloud/pubsub/pubsub_client.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,4 @@ pubsub_client_srcs = [
"subscriber_connection.cc",
"subscription.cc",
"topic.cc",
"version.cc",
]
27 changes: 0 additions & 27 deletions google/cloud/pubsub/version.cc

This file was deleted.

35 changes: 0 additions & 35 deletions google/cloud/pubsub/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,41 +42,6 @@ namespace pubsub {
* symbol becomes `pubsub::v1::Foo`.
*/
inline namespace GOOGLE_CLOUD_CPP_PUBSUB_NS {
/**
* The Cloud pubsub C++ Client major version.
*/
int constexpr VersionMajor() {
return GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MAJOR;
}

/**
* The Cloud pubsub C++ Client minor version.
*/
int constexpr VersionMinor() {
return GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MINOR;
}

/**
* The Cloud pubsub C++ Client patch version.
*/
int constexpr VersionPatch() {
return GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_PATCH;
}

/// A single integer representing the Major/Minor/Patch version.
int constexpr Version() {
static_assert(::google::cloud::version_major() == VersionMajor(),
"Mismatched major version");
static_assert(::google::cloud::version_minor() == VersionMinor(),
"Mismatched minor version");
static_assert(::google::cloud::version_patch() == VersionPatch(),
"Mismatched patch version");
return ::google::cloud::version();
}

/// The version as a string, in MAJOR.MINOR.PATCH+gitrev format.
std::string VersionString();

} // namespace GOOGLE_CLOUD_CPP_PUBSUB_NS
} // namespace pubsub
} // namespace cloud
Expand Down