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

cleanup: include protos via angle brackets #14509

Closed
Closed
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
12 changes: 12 additions & 0 deletions generator/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ cc_library(
name = "google_cloud_cpp_generator",
srcs = google_cloud_cpp_generator_srcs,
hdrs = google_cloud_cpp_generator_hdrs,
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
Expand Down Expand Up @@ -69,6 +72,9 @@ cc_library(
[cc_test(
name = test.replace("/", "_").replace(".cc", ""),
srcs = [test],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
Expand All @@ -84,6 +90,9 @@ cc_library(
cc_binary(
name = "protoc-gen-cpp_codegen",
srcs = ["plugin_main.cc"],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
Expand All @@ -106,6 +115,9 @@ cc_proto_library(
cc_binary(
name = "google-cloud-cpp-codegen",
srcs = ["standalone_main.cc"],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"@platforms//os:windows": ["@platforms//:incompatible"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

#include "generator/integration_tests/golden/v1/internal/golden_kitchen_sink_tracing_connection.h"
#include "generator/integration_tests/golden/v1/mocks/mock_golden_kitchen_sink_connection.h"
#include "generator/integration_tests/test.pb.h"
#include "google/cloud/mocks/mock_stream_range.h"
#include "google/cloud/internal/make_status.h"
#include "google/cloud/testing_util/opentelemetry_matchers.h"
#include "google/cloud/testing_util/status_matchers.h"
#include <generator/integration_tests/test.pb.h>
#include <gmock/gmock.h>
#include <memory>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// limitations under the License.

#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_auth_decorator.h"
#include "generator/integration_tests/test.pb.h"
#include "generator/integration_tests/tests/mock_golden_thing_admin_stub.h"
#include "google/cloud/testing_util/mock_grpc_authentication_strategy.h"
#include "google/cloud/testing_util/status_matchers.h"
#include <generator/integration_tests/test.pb.h>
#include <gmock/gmock.h>
#include <memory>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

#include "generator/integration_tests/golden/v1/internal/golden_thing_admin_tracing_connection.h"
#include "generator/integration_tests/golden/v1/mocks/mock_golden_thing_admin_connection.h"
#include "generator/integration_tests/test.pb.h"
#include "google/cloud/mocks/mock_stream_range.h"
#include "google/cloud/internal/make_status.h"
#include "google/cloud/testing_util/opentelemetry_matchers.h"
#include "google/cloud/testing_util/status_matchers.h"
#include <generator/integration_tests/test.pb.h>
#include <gmock/gmock.h>
#include <memory>

Expand Down
2 changes: 1 addition & 1 deletion generator/internal/descriptor_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

#include "generator/internal/descriptor_utils.h"
#include "generator/generator_config.pb.h"
#include "generator/internal/codegen_utils.h"
#include "generator/internal/doxygen.h"
#include "generator/internal/format_class_comments.h"
Expand All @@ -38,6 +37,7 @@
#include <google/longrunning/operations.pb.h>
#include <google/protobuf/compiler/code_generator.h>
#include <google/protobuf/compiler/cpp/names.h>
#include <generator/generator_config.pb.h>
#include <regex>
#include <set>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion generator/internal/scaffold_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_SCAFFOLD_GENERATOR_H
#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_SCAFFOLD_GENERATOR_H

#include "generator/generator_config.pb.h"
#include "absl/types/optional.h"
#include <generator/generator_config.pb.h>
#include <nlohmann/json.hpp>
#include <iosfwd>
#include <map>
Expand Down
2 changes: 1 addition & 1 deletion generator/internal/service_code_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_SERVICE_CODE_GENERATOR_H
#define GOOGLE_CLOUD_CPP_GENERATOR_INTERNAL_SERVICE_CODE_GENERATOR_H

#include "generator/generator_config.pb.h"
#include "generator/internal/codegen_utils.h"
#include "generator/internal/descriptor_utils.h"
#include "generator/internal/generator_interface.h"
#include "generator/internal/printer.h"
#include "google/cloud/status.h"
#include <google/protobuf/descriptor.h>
#include <generator/generator_config.pb.h>

namespace google {
namespace cloud {
Expand Down
2 changes: 1 addition & 1 deletion generator/standalone_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// limitations under the License.

#include "generator/generator.h"
#include "generator/generator_config.pb.h"
#include "generator/internal/codegen_utils.h"
#include "generator/internal/descriptor_utils.h"
#include "generator/internal/discovery_to_proto.h"
Expand All @@ -29,6 +28,7 @@
#include "absl/strings/match.h"
#include <google/protobuf/compiler/command_line_interface.h>
#include <google/protobuf/text_format.h>
#include <generator/generator_config.pb.h>
#include <algorithm>
#include <fstream>
#include <future>
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/bigtable/test_proxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ cc_library(
testonly = True,
srcs = ["cbt_test_proxy.cc"],
hdrs = ["cbt_test_proxy.h"],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
deps = [
":test_proxy_cc_grpc",
":test_proxy_cc_proto",
Expand All @@ -65,5 +68,8 @@ cc_binary(
name = "cbt_test_proxy_main",
testonly = True,
srcs = ["cbt_test_proxy_main.cc"],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
deps = [":cbt_test_proxy"],
)
2 changes: 1 addition & 1 deletion google/cloud/bigtable/test_proxy/cbt_test_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

#include "google/cloud/bigtable/data_connection.h"
#include "google/cloud/bigtable/table.h"
#include "google/cloud/bigtable/test_proxy/test_proxy.grpc.pb.h"
#include "google/cloud/version.h"
#include <google/cloud/bigtable/test_proxy/test_proxy.grpc.pb.h>
#include <memory>
#include <string>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/pubsub/samples/samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ void OptimisticSubscribe(std::vector<std::string> const& argv) {
namespace pubsub_admin = ::google::cloud::pubsub_admin;
namespace pubsub = ::google::cloud::pubsub;
namespace gc = ::google::cloud;
[](std::string project_id, std::string topic_id,
std::string subscription_id) {
[](std::string const& project_id, std::string topic_id,
std::string const& subscription_id) {
// Do not retry the attempts to consume messages.
auto subscriber = pubsub::Subscriber(
pubsub::MakeSubscriberConnection(
Expand Down
6 changes: 6 additions & 0 deletions google/cloud/spanner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ cc_library(
testonly = True,
srcs = spanner_client_testing_srcs,
hdrs = spanner_client_testing_hdrs,
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
visibility = [
":__subpackages__",
],
Expand Down Expand Up @@ -143,6 +146,9 @@ cc_library(
[cc_test(
name = test.replace("/", "_").replace(".cc", ""),
srcs = [test],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
deps = [
":google_cloud_cpp_spanner",
":google_cloud_cpp_spanner_mocks",
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/spanner/integration_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ licenses(["notice"]) # Apache 2.0
name = test.replace("/", "_").replace(".cc", ""),
timeout = "eternal",
srcs = [test],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
tags = [
"integration-test",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "google/cloud/spanner/database.h"
#include "google/cloud/spanner/mutations.h"
#include "google/cloud/spanner/testing/database_integration_test.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include "google/cloud/spanner/timestamp.h"
#include "google/cloud/testing_util/status_matchers.h"
#include "absl/time/time.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <gmock/gmock.h>
#include <cstdint>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner/proto_enum_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.

#include "google/cloud/spanner/proto_enum.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <gmock/gmock.h>
#include <sstream>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner/proto_message_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// limitations under the License.

#include "google/cloud/spanner/proto_message.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include "google/cloud/testing_util/is_proto_equal.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <gmock/gmock.h>
#include <sstream>

Expand Down
3 changes: 3 additions & 0 deletions google/cloud/spanner/samples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ licenses(["notice"]) # Apache 2.0
name = test.replace("/", "_").replace(".cc", ""),
timeout = "eternal",
srcs = [test],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
tags = [
"integration-test",
],
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner/samples/samples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "google/cloud/spanner/testing/random_backup_name.h"
#include "google/cloud/spanner/testing/random_database_name.h"
#include "google/cloud/spanner/testing/random_instance_name.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include "google/cloud/spanner/update_instance_request_builder.h"
#include "google/cloud/internal/getenv.h"
#include "google/cloud/internal/random.h"
Expand All @@ -42,6 +41,7 @@
#include "absl/time/clock.h"
#include "absl/time/time.h"
#include "absl/types/optional.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <chrono>
#include <iomanip>
#include <iterator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#include "google/cloud/spanner/testing/cleanup_stale_databases.h"
#include "google/cloud/spanner/testing/pick_random_instance.h"
#include "google/cloud/spanner/testing/random_database_name.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include "google/cloud/internal/absl_str_cat_quiet.h"
#include "google/cloud/internal/getenv.h"
#include "google/cloud/testing_util/status_matchers.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <chrono>
#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion google/cloud/spanner/value_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// limitations under the License.

#include "google/cloud/spanner/value.h"
#include "google/cloud/spanner/testing/singer.pb.h"
#include "google/cloud/internal/base64_transforms.h"
#include "google/cloud/testing_util/is_proto_equal.h"
#include "google/cloud/testing_util/status_matchers.h"
#include "absl/time/time.h"
#include "absl/types/optional.h"
#include <google/cloud/spanner/testing/singer.pb.h>
#include <google/protobuf/text_format.h>
#include <gmock/gmock.h>
#include <cmath>
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/storage/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ VARIATIONS = {
name = test.replace("/", "_").replace(".cc", "") + "-" + v_label,
timeout = "long",
srcs = [test],
# See #14507 for details, we need to use angle brackes to include *.pb.h
# files.
copts = ["-I$(GENDIR)"],
env = v_env,
linkopts = select({
"@platforms//os:windows": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
#include "google/cloud/storage/internal/base64.h"
#include "google/cloud/storage/internal/signed_url_requests.h"
#include "google/cloud/storage/list_objects_reader.h"
#include "google/cloud/storage/tests/conformance_tests.pb.h"
#include "google/cloud/internal/format_time_point.h"
#include "google/cloud/internal/getenv.h"
#include "google/cloud/internal/time_utils.h"
#include "google/cloud/terminate_handler.h"
#include "google/cloud/testing_util/scoped_environment.h"
#include "google/cloud/testing_util/status_matchers.h"
#include <google/cloud/storage/tests/conformance_tests.pb.h>
#include <google/protobuf/util/json_util.h>
#include <gmock/gmock.h>
#include <fstream>
Expand Down
Loading