Skip to content

Commit

Permalink
cleanup: include protos via angle brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
coryan committed Jul 30, 2024
1 parent 98628c9 commit 1cd9629
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 9 deletions.
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 @@ -22,6 +22,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 = [
"//:bigtable",
"//protos:system_includes",
Expand All @@ -34,5 +37,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"],
)
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 @@ -96,6 +96,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 @@ -127,6 +130,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
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
3 changes: 3 additions & 0 deletions google/cloud/storage/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,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

0 comments on commit 1cd9629

Please sign in to comment.