protos abrogation stage 1 - rename :: hpb for protos_generator

In this first stage, we rename the directory from protos_generator to hpb_generator, updating all necessary BUILD files and #includes.

PiperOrigin-RevId: 642600953
pull/17047/head
Hong Shin 9 months ago committed by Copybara-Service
parent fe6963970c
commit 968087eb61
  1. 8
      .github/workflows/test_upb.yml
  2. 0
      google3/third_party/upb/protos_generator/tests/basic_test_editions.proto
  3. 0
      hpb_generator/BUILD
  4. 0
      hpb_generator/README.md
  5. 10
      hpb_generator/gen_accessors.cc
  6. 4
      hpb_generator/gen_accessors.h
  7. 6
      hpb_generator/gen_enums.cc
  8. 2
      hpb_generator/gen_enums.h
  9. 6
      hpb_generator/gen_extensions.cc
  10. 2
      hpb_generator/gen_extensions.h
  11. 14
      hpb_generator/gen_messages.cc
  12. 2
      hpb_generator/gen_messages.h
  13. 14
      hpb_generator/gen_repeated_fields.cc
  14. 2
      hpb_generator/gen_repeated_fields.h
  15. 2
      hpb_generator/gen_utils.cc
  16. 0
      hpb_generator/gen_utils.h
  17. 2
      hpb_generator/names.cc
  18. 2
      hpb_generator/names.h
  19. 2
      hpb_generator/output.cc
  20. 0
      hpb_generator/output.h
  21. 12
      hpb_generator/protoc-gen-upb-protos.cc
  22. 0
      hpb_generator/tests/BUILD
  23. 18
      hpb_generator/tests/basic_test_editions.proto
  24. 2
      hpb_generator/tests/child_model.proto
  25. 0
      hpb_generator/tests/legacy-name.proto
  26. 0
      hpb_generator/tests/naming_conflict.proto
  27. 0
      hpb_generator/tests/no_package.proto
  28. 2
      hpb_generator/tests/no_package_enum_user.proto
  29. 0
      hpb_generator/tests/test_enum.proto
  30. 2
      hpb_generator/tests/test_extension.proto
  31. 6
      hpb_generator/tests/test_generated.cc
  32. 2
      hpb_generator/tests/test_model.proto
  33. 6
      protos/BUILD
  34. 2
      protos/bazel/upb_cc_proto_library.bzl
  35. 4
      protos/protos_extension_lock_test.cc
  36. 4
      protos/protos_internal_test.cc
  37. 2
      upb_generator/BUILD

@ -40,7 +40,7 @@ jobs:
image: us-docker.pkg.dev/protobuf-build/containers/test/linux/sanitize:${{ matrix.config.bazel_version || '6.3.0' }}-75f2a85ece6526cc3d54087018c0f1097d78d42b
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: upb-bazel
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/... ${{ matrix.config.flags }}
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 //bazel/... //benchmarks/... //lua/... //protos/... //hpb_generator/... //python/... //upb/... //upb_generator/... ${{ matrix.config.flags }}
exclude-targets: ${{ matrix.config.exclude-targets }}
linux-gcc:
@ -59,7 +59,7 @@ jobs:
image: "us-docker.pkg.dev/protobuf-build/containers/test/linux/gcc:12.2-6.3.0-63dd26c0c7a808d92673a3e52e848189d4ab0f17"
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: "upb-bazel-gcc"
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/...
bazel: test --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 -c opt //bazel/... //benchmarks/... //lua/... //protos/... //hpb_generator/... //python/... //upb/... //upb_generator/...
windows:
strategy:
@ -80,7 +80,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: "upb-bazel-windows"
bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/... //upb_generator/... //python/... //protos/... //protos_generator/...
bazel: test --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 //upb/... //upb_generator/... //python/... //protos/... //hpb_generator/...
version: 6.3.0
exclude-targets: -//python:conformance_test -//upb/reflection:def_builder_test
@ -107,7 +107,7 @@ jobs:
with:
credentials: ${{ secrets.GAR_SERVICE_ACCOUNT }}
bazel-cache: "upb-bazel-macos"
bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //bazel/... //benchmarks/... //lua/... //protos/... //protos_generator/... //python/... //upb/... //upb_generator/...
bazel: ${{ matrix.config.bazel-command }} --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 ${{ matrix.config.flags }} //bazel/... //benchmarks/... //lua/... //protos/... //hpb_generator/... //python/... //upb/... //upb_generator/...
version: 6.3.0
no-python:

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_accessors.h"
#include "hpb_generator/gen_accessors.h"
#include <string>
@ -14,10 +14,10 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_repeated_fields.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "protos_generator/output.h"
#include "hpb_generator/gen_repeated_fields.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
#include "hpb_generator/output.h"
#include "upb_generator/common.h"
#include "upb_generator/keywords.h"
#include "upb_generator/names.h"

@ -9,8 +9,8 @@
#define UPB_PROTOS_GENERATOR_ACCESSORS_H_
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/output.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/output.h"
namespace protos_generator {

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_enums.h"
#include "hpb_generator/gen_enums.h"
#include <algorithm>
#include <limits>
@ -14,8 +14,8 @@
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
namespace protos_generator {

@ -9,7 +9,7 @@
#define UPB_PROTOS_GENERATOR_ENUMS_H_
#include "google/protobuf/descriptor.h"
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
namespace protos_generator {

@ -5,11 +5,11 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_extensions.h"
#include "hpb_generator/gen_extensions.h"
#include "absl/strings/str_cat.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
namespace protos_generator {

@ -9,7 +9,7 @@
#define UPB_PROTOS_GENERATOR_GEN_EXTENSIONS_H_
#include "google/protobuf/descriptor.h"
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
namespace protos_generator {

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_messages.h"
#include "hpb_generator/gen_messages.h"
#include <cstddef>
#include <string>
@ -16,12 +16,12 @@
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_accessors.h"
#include "protos_generator/gen_enums.h"
#include "protos_generator/gen_extensions.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "protos_generator/output.h"
#include "hpb_generator/gen_accessors.h"
#include "hpb_generator/gen_enums.h"
#include "hpb_generator/gen_extensions.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
#include "hpb_generator/output.h"
#include "upb_generator/common.h"
#include "upb_generator/file_layout.h"

@ -9,7 +9,7 @@
#define UPB_PROTOS_GENERATOR_GEN_MESSAGES_H_
#include "google/protobuf/descriptor.h"
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
namespace protos_generator {
namespace protobuf = ::google::protobuf;

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_repeated_fields.h"
#include "hpb_generator/gen_repeated_fields.h"
#include <string>
#include <vector>
@ -13,12 +13,12 @@
#include "google/protobuf/descriptor.pb.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_accessors.h"
#include "protos_generator/gen_enums.h"
#include "protos_generator/gen_extensions.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "protos_generator/output.h"
#include "hpb_generator/gen_accessors.h"
#include "hpb_generator/gen_enums.h"
#include "hpb_generator/gen_extensions.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
#include "hpb_generator/output.h"
#include "upb_generator/common.h"
#include "upb_generator/file_layout.h"
#include "upb_generator/names.h"

@ -10,7 +10,7 @@
#include "absl/strings/string_view.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
namespace protos_generator {
namespace protobuf = ::google::protobuf;

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/gen_utils.h"
#include "hpb_generator/gen_utils.h"
#include <algorithm>
#include <string>

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/names.h"
#include "hpb_generator/names.h"
#include <string>

@ -11,7 +11,7 @@
#include <string>
#include "google/protobuf/descriptor.pb.h"
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
namespace protos_generator {

@ -5,7 +5,7 @@
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#include "protos_generator/output.h"
#include "hpb_generator/output.h"
#include <string>

@ -15,12 +15,12 @@
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/compiler/plugin.h"
#include "google/protobuf/descriptor.h"
#include "protos_generator/gen_enums.h"
#include "protos_generator/gen_extensions.h"
#include "protos_generator/gen_messages.h"
#include "protos_generator/gen_utils.h"
#include "protos_generator/names.h"
#include "protos_generator/output.h"
#include "hpb_generator/gen_enums.h"
#include "hpb_generator/gen_extensions.h"
#include "hpb_generator/gen_messages.h"
#include "hpb_generator/gen_utils.h"
#include "hpb_generator/names.h"
#include "hpb_generator/output.h"
namespace protos_generator {
namespace {

@ -0,0 +1,18 @@
edition = "2023";
package editions_upb_test;
option features.enum_type = CLOSED;
option features.field_presence = IMPLICIT;
message TestFeaturesMessage {
int32 implicit = 1;
int32 explicit = 2 [features.field_presence = EXPLICIT];
int32 legacy_required = 3 [features.field_presence = LEGACY_REQUIRED];
repeated int32 packed = 50;
repeated int32 expanded = 51 [features.repeated_field_encoding = EXPANDED];
TestFeaturesMessage delimited = 100 [features.message_encoding = DELIMITED];
TestFeaturesMessage length_prefixed = 101;
}

@ -9,7 +9,7 @@ syntax = "proto3";
package protos_generator.test;
import public "protos_generator/tests/test_enum.proto";
import public "hpb_generator/tests/test_enum.proto";
message ChildModel1 {
optional bool child_b1 = 44;

@ -9,7 +9,7 @@ syntax = "proto2";
package protos_generator.tests;
import "protos_generator/tests/no_package.proto";
import "hpb_generator/tests/no_package.proto";
// option java_multiple_files = true;

@ -9,7 +9,7 @@ syntax = "proto2";
package protos_generator.test.someotherpackage;
import "protos_generator/tests/test_model.proto";
import "hpb_generator/tests/test_model.proto";
// Define extension that is extending proto outside this package with a type
// defined in different file.

@ -18,13 +18,13 @@
#include <gtest/gtest.h>
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "hpb_generator/tests/child_model.upb.proto.h"
#include "hpb_generator/tests/no_package.upb.proto.h"
#include "hpb_generator/tests/test_model.upb.proto.h"
#include "protos/protos.h"
#include "protos/repeated_field.h"
#include "protos/repeated_field_iterator.h"
#include "protos/requires.h"
#include "protos_generator/tests/child_model.upb.proto.h"
#include "protos_generator/tests/no_package.upb.proto.h"
#include "protos_generator/tests/test_model.upb.proto.h"
#include "upb/mem/arena.h"
#include "upb/mem/arena.hpp"

@ -9,7 +9,7 @@ syntax = "proto2";
package protos_generator.test;
import "protos_generator/tests/child_model.proto";
import "hpb_generator/tests/child_model.proto";
message TestModelContainer {
repeated TestModel models = 1;

@ -129,8 +129,8 @@ cc_test(
copts = UPB_DEFAULT_CPPOPTS,
deps = [
":protos_internal",
"//protos_generator/tests:test_model_upb_cc_proto",
"//protos_generator/tests:test_model_upb_proto",
"//hpb_generator/tests:test_model_upb_cc_proto",
"//hpb_generator/tests:test_model_upb_proto",
"//upb:mem",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
@ -157,9 +157,9 @@ cc_test(
name = "protos_extension_lock_test",
srcs = ["protos_extension_lock_test.cc"],
deps = [
"//hpb_generator/tests:test_model_upb_cc_proto",
"//protos",
"//protos:protos_extension_lock",
"//protos_generator/tests:test_model_upb_cc_proto",
"//upb:mem",
"@com_google_absl//absl/hash",
"@com_google_absl//absl/log:absl_check",

@ -240,7 +240,7 @@ _upb_cc_proto_library_aspect = aspect(
"_gen_upbprotos": attr.label(
executable = True,
cfg = "exec",
default = "//protos_generator:protoc-gen-upb-protos",
default = "//hpb_generator:protoc-gen-upb-protos",
),
"_protoc": attr.label(
executable = True,

@ -16,8 +16,8 @@
#include <gtest/gtest.h>
#include "absl/hash/hash.h"
#include "absl/log/absl_check.h"
#include "hpb_generator/tests/test_model.upb.proto.h"
#include "protos/protos.h"
#include "protos_generator/tests/test_model.upb.proto.h"
#include "upb/mem/arena.hpp"
#ifndef ASSERT_OK
@ -125,4 +125,4 @@ TEST(CppGeneratedCode, ConcurrentAccessDoesNotRaceBothEager) {
#endif // _MSC_VER
} // namespace
} // namespace protos_generator::test::protos
} // namespace protos_generator::test::protos

@ -9,8 +9,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "protos_generator/tests/test_model.upb.h"
#include "protos_generator/tests/test_model.upb.proto.h"
#include "hpb_generator/tests/test_model.upb.h"
#include "hpb_generator/tests/test_model.upb.proto.h"
#include "upb/mem/arena.h"
namespace protos::testing {

@ -143,7 +143,7 @@ cc_library(
"keywords.h",
],
copts = UPB_DEFAULT_CPPOPTS,
visibility = ["//protos_generator:__pkg__"],
visibility = ["//hpb_generator:__pkg__"],
)
bootstrap_cc_library(

Loading…
Cancel
Save