From 53d8b03643dede0c6f7948e90eae24dc4fd4150b Mon Sep 17 00:00:00 2001 From: Thomas Van Lenten Date: Tue, 4 Oct 2022 10:59:48 -0400 Subject: [PATCH] [ObjC] rename the file to drop the "objectivec_" prefix. Since "names.(h|cc)" now exists, drop the prefixing on all the files. --- objectivec/DevTools/check_version_stamps.sh | 2 +- objectivec/GPBDescriptor.m | 4 +- objectivec/Tests/GPBMessageTests.m | 11 ++-- src/file_lists.cmake | 52 +++++++++---------- src/google/protobuf/compiler/main.cc | 2 +- .../protobuf/compiler/objectivec/BUILD.bazel | 52 +++++++++---------- .../{objectivec_enum.cc => enum.cc} | 4 +- .../objectivec/{objectivec_enum.h => enum.h} | 0 ...objectivec_enum_field.cc => enum_field.cc} | 4 +- .../{objectivec_enum_field.h => enum_field.h} | 2 +- .../{objectivec_extension.cc => extension.cc} | 4 +- .../{objectivec_extension.h => extension.h} | 0 .../{objectivec_field.cc => field.cc} | 12 ++--- .../{objectivec_field.h => field.h} | 0 .../{objectivec_file.cc => file.cc} | 10 ++-- .../objectivec/{objectivec_file.h => file.h} | 2 +- .../{objectivec_generator.cc => generator.cc} | 6 +-- .../{objectivec_generator.h => generator.h} | 0 .../{objectivec_helpers.h => helpers.h} | 0 ...elpers_unittest.cc => helpers_unittest.cc} | 2 +- .../{objectivec_map_field.cc => map_field.cc} | 4 +- .../{objectivec_map_field.h => map_field.h} | 2 +- .../{objectivec_message.cc => message.cc} | 8 +-- .../{objectivec_message.h => message.h} | 4 +- ...ivec_message_field.cc => message_field.cc} | 4 +- ...ctivec_message_field.h => message_field.h} | 2 +- .../compiler/objectivec/method_dump.sh | 12 ++--- .../protobuf/compiler/objectivec/names.cc | 4 +- .../protobuf/compiler/objectivec/names.h | 2 +- ..._nsobject_methods.h => nsobject_methods.h} | 0 .../{objectivec_oneof.cc => oneof.cc} | 4 +- .../{objectivec_oneof.h => oneof.h} | 0 .../{objectivec_options.h => options.h} | 2 +- ..._primitive_field.cc => primitive_field.cc} | 8 +-- ...ec_primitive_field.h => primitive_field.h} | 2 +- 35 files changed, 113 insertions(+), 114 deletions(-) rename src/google/protobuf/compiler/objectivec/{objectivec_enum.cc => enum.cc} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_enum.h => enum.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_enum_field.cc => enum_field.cc} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_enum_field.h => enum_field.h} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_extension.cc => extension.cc} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_extension.h => extension.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_field.cc => field.cc} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_field.h => field.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_file.cc => file.cc} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_file.h => file.h} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_generator.cc => generator.cc} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_generator.h => generator.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_helpers.h => helpers.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_helpers_unittest.cc => helpers_unittest.cc} (99%) rename src/google/protobuf/compiler/objectivec/{objectivec_map_field.cc => map_field.cc} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_map_field.h => map_field.h} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_message.cc => message.cc} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_message.h => message.h} (96%) rename src/google/protobuf/compiler/objectivec/{objectivec_message_field.cc => message_field.cc} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_message_field.h => message_field.h} (98%) rename src/google/protobuf/compiler/objectivec/{objectivec_nsobject_methods.h => nsobject_methods.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_oneof.cc => oneof.cc} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_oneof.h => oneof.h} (100%) rename src/google/protobuf/compiler/objectivec/{objectivec_options.h => options.h} (97%) rename src/google/protobuf/compiler/objectivec/{objectivec_primitive_field.cc => primitive_field.cc} (95%) rename src/google/protobuf/compiler/objectivec/{objectivec_primitive_field.h => primitive_field.h} (98%) diff --git a/objectivec/DevTools/check_version_stamps.sh b/objectivec/DevTools/check_version_stamps.sh index a3524cb39d5b..5972e35fb598 100755 --- a/objectivec/DevTools/check_version_stamps.sh +++ b/objectivec/DevTools/check_version_stamps.sh @@ -16,7 +16,7 @@ die() { exit 1 } -readonly GeneratorSrc="${ProtoRootDir}/src/google/protobuf/compiler/objectivec/objectivec_file.cc" +readonly GeneratorSrc="${ProtoRootDir}/src/google/protobuf/compiler/objectivec/file.cc" readonly RuntimeSrc="${ProtoRootDir}/objectivec/GPBBootstrap.h" check_constant() { diff --git a/objectivec/GPBDescriptor.m b/objectivec/GPBDescriptor.m index 72368cefda02..316ce76a6c37 100644 --- a/objectivec/GPBDescriptor.m +++ b/objectivec/GPBDescriptor.m @@ -681,7 +681,7 @@ - (NSString *)textFormatName { } // The logic here has to match SetCommonFieldVariables() from - // objectivec_field.cc in the proto compiler. + // objectivec/field.cc in the proto compiler. NSString *name = self.name; NSUInteger len = [name length]; @@ -918,7 +918,7 @@ - (NSString *)getEnumTextFormatNameForIndex:(uint32_t)index { if (extraTextFormatInfo_) { result = GPBDecodeTextFormatName(extraTextFormatInfo_, (int32_t)index, shortName); } - // Logic here needs to match what objectivec_enum.cc does in the proto + // Logic here needs to match what objectivec/enum.cc does in the proto // compiler. if (result == nil) { NSUInteger len = [shortName length]; diff --git a/objectivec/Tests/GPBMessageTests.m b/objectivec/Tests/GPBMessageTests.m index 83b8d1172de6..7d4cf79c3df2 100644 --- a/objectivec/Tests/GPBMessageTests.m +++ b/objectivec/Tests/GPBMessageTests.m @@ -1843,8 +1843,8 @@ - (void)testEnumDescriptorFromExtensionDescriptor { } - (void)testPropertyNaming { - // objectivec_helpers.cc has some special handing to get proper all caps - // for a few cases to meet objc developer expectations. + // names.cc has some special handing to get proper all caps for a few cases to + // meet objc developer expectations. // // This "test" confirms that the expected names are generated, otherwise the // test itself will fail to compile. @@ -1861,7 +1861,7 @@ - (void)testPropertyNaming { } - (void)testEnumNaming { - // objectivec_helpers.cc has some interesting cases to deal with in + // names.cc has some interesting cases to deal with in // EnumValueName/EnumValueShortName. Confirm that things generated as // expected. @@ -1966,9 +1966,8 @@ - (void)testNegativeEnums { } - (void)testReservedWordNaming { - // objectivec_helpers.cc has some special handing to make sure that - // some "reserved" objc names get renamed in a way so they - // don't conflict. + // names.cc has some special handing to make sure that some "reserved" objc + // names get renamed in a way so they don't conflict. // // This "test" confirms that the expected names are generated, // otherwise the test itself will fail to compile. diff --git a/src/file_lists.cmake b/src/file_lists.cmake index e874574e8245..c701b6619b99 100644 --- a/src/file_lists.cmake +++ b/src/file_lists.cmake @@ -350,18 +350,18 @@ set(libprotoc_srcs ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/shared_code_generator.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/string_field.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/string_field_lite.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/enum.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/enum_field.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/extension.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/field.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/file.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/generator.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/map_field.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/message.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/message_field.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/names.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_field.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_file.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_generator.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/oneof.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/primitive_field.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/names.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/php_generator.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.cc @@ -446,21 +446,21 @@ set(libprotoc_hdrs ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/shared_code_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/string_field.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/string_field_lite.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/enum.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/enum_field.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/extension.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/field.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/file.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/generator.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/helpers.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/map_field.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/message.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/message_field.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/names.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_extension.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_field.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_file.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_generator.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_helpers.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_map_field.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message_field.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_oneof.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_options.h - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/nsobject_methods.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/oneof.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/options.h + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/primitive_field.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/names.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/php_generator.h ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.h @@ -679,7 +679,7 @@ set(compiler_test_files ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/doc_comment_unittest.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/message_serialization_unittest.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/plugin_unittest.cc - ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc + ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/helpers_unittest.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/parser_unittest.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/python/plugin_unittest.cc ${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc diff --git a/src/google/protobuf/compiler/main.cc b/src/google/protobuf/compiler/main.cc index ecaf76b9819e..052943e45452 100644 --- a/src/google/protobuf/compiler/main.cc +++ b/src/google/protobuf/compiler/main.cc @@ -33,7 +33,7 @@ #include "google/protobuf/compiler/java/kotlin_generator.h" #include "google/protobuf/compiler/command_line_interface.h" #include "google/protobuf/compiler/csharp/csharp_generator.h" -#include "google/protobuf/compiler/objectivec/objectivec_generator.h" +#include "google/protobuf/compiler/objectivec/generator.h" #include "google/protobuf/compiler/php/php_generator.h" #include "google/protobuf/compiler/python/generator.h" #include "google/protobuf/compiler/python/pyi_generator.h" diff --git a/src/google/protobuf/compiler/objectivec/BUILD.bazel b/src/google/protobuf/compiler/objectivec/BUILD.bazel index 248e2ab8cde4..465888c9169f 100644 --- a/src/google/protobuf/compiler/objectivec/BUILD.bazel +++ b/src/google/protobuf/compiler/objectivec/BUILD.bazel @@ -21,7 +21,7 @@ cc_library( name = "names_internal", hdrs = [ "names.h", - "objectivec_nsobject_methods.h", + "nsobject_methods.h", ], srcs = [ "names.cc", @@ -38,32 +38,32 @@ cc_library( cc_library( name = "objectivec", srcs = [ - "objectivec_enum.cc", - "objectivec_enum_field.cc", - "objectivec_extension.cc", - "objectivec_field.cc", - "objectivec_file.cc", - "objectivec_generator.cc", - "objectivec_map_field.cc", - "objectivec_message.cc", - "objectivec_message_field.cc", - "objectivec_oneof.cc", - "objectivec_primitive_field.cc", + "enum.cc", + "enum_field.cc", + "extension.cc", + "field.cc", + "file.cc", + "generator.cc", + "map_field.cc", + "message.cc", + "message_field.cc", + "oneof.cc", + "primitive_field.cc", ], hdrs = [ - "objectivec_enum.h", - "objectivec_enum_field.h", - "objectivec_extension.h", - "objectivec_field.h", - "objectivec_file.h", - "objectivec_generator.h", - "objectivec_helpers.h", - "objectivec_map_field.h", - "objectivec_message.h", - "objectivec_message_field.h", - "objectivec_oneof.h", - "objectivec_options.h", - "objectivec_primitive_field.h", + "enum.h", + "enum_field.h", + "extension.h", + "field.h", + "file.h", + "generator.h", + "helpers.h", + "map_field.h", + "message.h", + "message_field.h", + "oneof.h", + "options.h", + "primitive_field.h", ], copts = COPTS, include_prefix = "google/protobuf/compiler/objectivec", @@ -81,7 +81,7 @@ cc_library( cc_test( name = "helpers_unittest", - srcs = ["objectivec_helpers_unittest.cc"], + srcs = ["helpers_unittest.cc"], deps = [ ":objectivec", "//src/google/protobuf/io", diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc b/src/google/protobuf/compiler/objectivec/enum.cc similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_enum.cc rename to src/google/protobuf/compiler/objectivec/enum.cc index 13954ca563b5..32a2549c6bbe 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum.cc +++ b/src/google/protobuf/compiler/objectivec/enum.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_enum.h" +#include "google/protobuf/compiler/objectivec/enum.h" #include #include @@ -36,7 +36,7 @@ #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum.h b/src/google/protobuf/compiler/objectivec/enum.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_enum.h rename to src/google/protobuf/compiler/objectivec/enum.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc b/src/google/protobuf/compiler/objectivec/enum_field.cc similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc rename to src/google/protobuf/compiler/objectivec/enum_field.cc index 049ff475d50e..58d4ed9f4031 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc +++ b/src/google/protobuf/compiler/objectivec/enum_field.cc @@ -31,8 +31,8 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_enum_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/enum_field.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h b/src/google/protobuf/compiler/objectivec/enum_field.h similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_enum_field.h rename to src/google/protobuf/compiler/objectivec/enum_field.h index 7bd3c32c752a..1cbd6cffad05 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h +++ b/src/google/protobuf/compiler/objectivec/enum_field.h @@ -33,7 +33,7 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_field.h" +#include "google/protobuf/compiler/objectivec/field.h" namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc b/src/google/protobuf/compiler/objectivec/extension.cc similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_extension.cc rename to src/google/protobuf/compiler/objectivec/extension.cc index c97c9feade72..fce45e59cda9 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_extension.cc +++ b/src/google/protobuf/compiler/objectivec/extension.cc @@ -28,12 +28,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_extension.h" +#include "google/protobuf/compiler/objectivec/extension.h" #include #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/io/printer.h" diff --git a/src/google/protobuf/compiler/objectivec/objectivec_extension.h b/src/google/protobuf/compiler/objectivec/extension.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_extension.h rename to src/google/protobuf/compiler/objectivec/extension.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.cc b/src/google/protobuf/compiler/objectivec/field.cc similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_field.cc rename to src/google/protobuf/compiler/objectivec/field.cc index b98955b6328c..8c192945b33a 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_field.cc +++ b/src/google/protobuf/compiler/objectivec/field.cc @@ -28,16 +28,16 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_field.h" +#include "google/protobuf/compiler/objectivec/field.h" #include #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_enum_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" -#include "google/protobuf/compiler/objectivec/objectivec_map_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_message_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_primitive_field.h" +#include "google/protobuf/compiler/objectivec/enum_field.h" +#include "google/protobuf/compiler/objectivec/helpers.h" +#include "google/protobuf/compiler/objectivec/map_field.h" +#include "google/protobuf/compiler/objectivec/message_field.h" +#include "google/protobuf/compiler/objectivec/primitive_field.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_field.h b/src/google/protobuf/compiler/objectivec/field.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_field.h rename to src/google/protobuf/compiler/objectivec/field.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.cc b/src/google/protobuf/compiler/objectivec/file.cc similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_file.cc rename to src/google/protobuf/compiler/objectivec/file.cc index fc51baf86614..d09ed7ead66b 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_file.cc +++ b/src/google/protobuf/compiler/objectivec/file.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_file.h" +#include "google/protobuf/compiler/objectivec/file.h" #include #include @@ -36,10 +36,10 @@ #include "google/protobuf/compiler/code_generator.h" #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_enum.h" -#include "google/protobuf/compiler/objectivec/objectivec_extension.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" -#include "google/protobuf/compiler/objectivec/objectivec_message.h" +#include "google/protobuf/compiler/objectivec/enum.h" +#include "google/protobuf/compiler/objectivec/extension.h" +#include "google/protobuf/compiler/objectivec/helpers.h" +#include "google/protobuf/compiler/objectivec/message.h" #include "google/protobuf/io/printer.h" // NOTE: src/google/protobuf/compiler/plugin.cc makes use of cerr for some diff --git a/src/google/protobuf/compiler/objectivec/objectivec_file.h b/src/google/protobuf/compiler/objectivec/file.h similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_file.h rename to src/google/protobuf/compiler/objectivec/file.h index 506361192329..1af0f54906c0 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_file.h +++ b/src/google/protobuf/compiler/objectivec/file.h @@ -35,7 +35,7 @@ #include #include #include -#include "google/protobuf/compiler/objectivec/objectivec_options.h" +#include "google/protobuf/compiler/objectivec/options.h" #include "google/protobuf/descriptor.h" #include "google/protobuf/io/printer.h" diff --git a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc b/src/google/protobuf/compiler/objectivec/generator.cc similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_generator.cc rename to src/google/protobuf/compiler/objectivec/generator.cc index e5f2fb3d6edf..e0e0e29def4f 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_generator.cc +++ b/src/google/protobuf/compiler/objectivec/generator.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_generator.h" +#include "google/protobuf/compiler/objectivec/generator.h" #include #include @@ -38,8 +38,8 @@ #include "absl/strings/ascii.h" #include "absl/strings/str_split.h" #include "absl/strings/strip.h" -#include "google/protobuf/compiler/objectivec/objectivec_file.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/file.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" #include "google/protobuf/io/zero_copy_stream.h" diff --git a/src/google/protobuf/compiler/objectivec/objectivec_generator.h b/src/google/protobuf/compiler/objectivec/generator.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_generator.h rename to src/google/protobuf/compiler/objectivec/generator.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers.h b/src/google/protobuf/compiler/objectivec/helpers.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_helpers.h rename to src/google/protobuf/compiler/objectivec/helpers.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc b/src/google/protobuf/compiler/objectivec/helpers_unittest.cc similarity index 99% rename from src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc rename to src/google/protobuf/compiler/objectivec/helpers_unittest.cc index e6d0a7c613a7..d73efb34aad4 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc +++ b/src/google/protobuf/compiler/objectivec/helpers_unittest.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/zero_copy_stream_impl_lite.h" #include diff --git a/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc b/src/google/protobuf/compiler/objectivec/map_field.cc similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_map_field.cc rename to src/google/protobuf/compiler/objectivec/map_field.cc index 087bd8fb2dd1..bbc590cd0504 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc +++ b/src/google/protobuf/compiler/objectivec/map_field.cc @@ -31,8 +31,8 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_map_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/map_field.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_map_field.h b/src/google/protobuf/compiler/objectivec/map_field.h similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_map_field.h rename to src/google/protobuf/compiler/objectivec/map_field.h index 20c538e3bb43..bea9f6dd34c0 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_map_field.h +++ b/src/google/protobuf/compiler/objectivec/map_field.h @@ -34,7 +34,7 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_field.h" +#include "google/protobuf/compiler/objectivec/field.h" namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message.cc b/src/google/protobuf/compiler/objectivec/message.cc similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_message.cc rename to src/google/protobuf/compiler/objectivec/message.cc index 98161494da00..530b7cd88b03 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_message.cc +++ b/src/google/protobuf/compiler/objectivec/message.cc @@ -28,7 +28,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_message.h" +#include "google/protobuf/compiler/objectivec/message.h" #include #include @@ -36,9 +36,9 @@ #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_enum.h" -#include "google/protobuf/compiler/objectivec/objectivec_extension.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/enum.h" +#include "google/protobuf/compiler/objectivec/extension.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/io/printer.h" diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message.h b/src/google/protobuf/compiler/objectivec/message.h similarity index 96% rename from src/google/protobuf/compiler/objectivec/objectivec_message.h rename to src/google/protobuf/compiler/objectivec/message.h index 641a51863856..7eb8c2df984e 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_message.h +++ b/src/google/protobuf/compiler/objectivec/message.h @@ -34,8 +34,8 @@ #include #include #include -#include "google/protobuf/compiler/objectivec/objectivec_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_oneof.h" +#include "google/protobuf/compiler/objectivec/field.h" +#include "google/protobuf/compiler/objectivec/oneof.h" #include "google/protobuf/descriptor.h" #include "google/protobuf/io/printer.h" diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc b/src/google/protobuf/compiler/objectivec/message_field.cc similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_message_field.cc rename to src/google/protobuf/compiler/objectivec/message_field.cc index e889c6ef5ebc..675b479b28e8 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc +++ b/src/google/protobuf/compiler/objectivec/message_field.cc @@ -31,8 +31,8 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_message_field.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/message_field.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_message_field.h b/src/google/protobuf/compiler/objectivec/message_field.h similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_message_field.h rename to src/google/protobuf/compiler/objectivec/message_field.h index 19f23a29e7b3..7ed1cf24fff2 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_message_field.h +++ b/src/google/protobuf/compiler/objectivec/message_field.h @@ -34,7 +34,7 @@ #include #include -#include "google/protobuf/compiler/objectivec/objectivec_field.h" +#include "google/protobuf/compiler/objectivec/field.h" namespace google { namespace protobuf { diff --git a/src/google/protobuf/compiler/objectivec/method_dump.sh b/src/google/protobuf/compiler/objectivec/method_dump.sh index 193825dbc128..6592212814a9 100755 --- a/src/google/protobuf/compiler/objectivec/method_dump.sh +++ b/src/google/protobuf/compiler/objectivec/method_dump.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Updates objectivec_nsobject_methods.h by generating a list of all of the properties -# and methods on NSObject that Protobufs should not overload from iOS and macOS combined. +# Updates nsobject_methods.h by generating a list of all of the properties and +# methods on NSObject that Protobufs should not overload from iOS and macOS combined. # # The rules: # - No property should ever be overloaded. @@ -110,7 +110,7 @@ END_FOOTER ) # Check to make sure we are updating the correct file. -if [[ ! -e "objectivec_nsobject_methods.h" ]]; then +if [[ ! -e "nsobject_methods.h" ]]; then echo "error: Must be run in the src/google/protobuf/compiler/objectivec directory" exit 1 fi @@ -154,7 +154,7 @@ echo $"$file_footer" >> "$temp_dir"/methods_sorted.txt # Check for differences. Turn off error checking because we expect diff to fail when # there are no differences. set +e -diff_out=$(diff -I "^//.*$" "$temp_dir"/methods_sorted.txt objectivec_nsobject_methods.h) +diff_out=$(diff -I "^//.*$" "$temp_dir"/methods_sorted.txt nsobject_methods.h) removed_methods=$(echo "$diff_out" | grep '^>.*$') set -e if [[ -n "$removed_methods" ]]; then @@ -168,12 +168,12 @@ if [[ -n "$removed_methods" ]]; then echo "$removed_methods" echo "" echo "New Version: $temp_dir/methods_sorted.txt" - echo "Old Version: objectivec_nsobject_methods.h" + echo "Old Version: nsobject_methods.h" exit 1 fi if [[ -n "$diff_out" ]]; then echo "Added Methods:" echo "$(echo "$diff_out" | grep '^<.*$' | sed -e 's/^< "\(.*\)",$/ \1/')" fi; -cp "$temp_dir"/methods_sorted.txt objectivec_nsobject_methods.h +cp "$temp_dir"/methods_sorted.txt nsobject_methods.h rm -rf "$temp_dir" diff --git a/src/google/protobuf/compiler/objectivec/names.cc b/src/google/protobuf/compiler/objectivec/names.cc index 5ae447fe4b43..a72da60e057c 100644 --- a/src/google/protobuf/compiler/objectivec/names.cc +++ b/src/google/protobuf/compiler/objectivec/names.cc @@ -50,7 +50,7 @@ #include "absl/strings/str_split.h" #include "absl/strings/strip.h" #include "google/protobuf/compiler/objectivec/names.h" -#include "google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h" +#include "google/protobuf/compiler/objectivec/nsobject_methods.h" #include "google/protobuf/descriptor.pb.h" #include "google/protobuf/io/coded_stream.h" #include "google/protobuf/io/io_win32.h" @@ -377,7 +377,7 @@ std::string UnderscoresToCamelCase(const std::string& input, const char* const kReservedWordList[] = { // Note NSObject Methods: - // These are brought in from objectivec_nsobject_methods.h that is generated + // These are brought in from nsobject_methods.h that is generated // using method_dump.sh. See kNSObjectMethods below. // Objective C "keywords" that aren't in C diff --git a/src/google/protobuf/compiler/objectivec/names.h b/src/google/protobuf/compiler/objectivec/names.h index e75738f323ca..83fb24c37aa8 100644 --- a/src/google/protobuf/compiler/objectivec/names.h +++ b/src/google/protobuf/compiler/objectivec/names.h @@ -70,7 +70,7 @@ void PROTOC_EXPORT SetProtoPackagePrefixExceptionList( std::string PROTOC_EXPORT GetForcedPackagePrefix(); void PROTOC_EXPORT SetForcedPackagePrefix(const std::string& prefix); -// Generator Prefix Validation Options (see objectivec_generator.cc for a +// Generator Prefix Validation Options (see generator.cc for a // description of each): struct Options { Options(); diff --git a/src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h b/src/google/protobuf/compiler/objectivec/nsobject_methods.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h rename to src/google/protobuf/compiler/objectivec/nsobject_methods.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc b/src/google/protobuf/compiler/objectivec/oneof.cc similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_oneof.cc rename to src/google/protobuf/compiler/objectivec/oneof.cc index 279928bba468..22024988c262 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_oneof.cc +++ b/src/google/protobuf/compiler/objectivec/oneof.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_oneof.h" +#include "google/protobuf/compiler/objectivec/oneof.h" #include #include #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { diff --git a/src/google/protobuf/compiler/objectivec/objectivec_oneof.h b/src/google/protobuf/compiler/objectivec/oneof.h similarity index 100% rename from src/google/protobuf/compiler/objectivec/objectivec_oneof.h rename to src/google/protobuf/compiler/objectivec/oneof.h diff --git a/src/google/protobuf/compiler/objectivec/objectivec_options.h b/src/google/protobuf/compiler/objectivec/options.h similarity index 97% rename from src/google/protobuf/compiler/objectivec/objectivec_options.h rename to src/google/protobuf/compiler/objectivec/options.h index 07b90b3d699b..388d1cabfeeb 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_options.h +++ b/src/google/protobuf/compiler/objectivec/options.h @@ -38,7 +38,7 @@ namespace protobuf { namespace compiler { namespace objectivec { -// Generation options, documented within objectivec_generator.cc. +// Generation options, documented within generator.cc. struct GenerationOptions { std::string generate_for_named_framework; std::string named_framework_to_proto_path_mappings_path; diff --git a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc b/src/google/protobuf/compiler/objectivec/primitive_field.cc similarity index 95% rename from src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc rename to src/google/protobuf/compiler/objectivec/primitive_field.cc index c9339a5aaa72..b64dd42e10dc 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc +++ b/src/google/protobuf/compiler/objectivec/primitive_field.cc @@ -28,13 +28,13 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "google/protobuf/compiler/objectivec/objectivec_primitive_field.h" +#include "google/protobuf/compiler/objectivec/primitive_field.h" #include #include #include "absl/strings/str_cat.h" -#include "google/protobuf/compiler/objectivec/objectivec_helpers.h" +#include "google/protobuf/compiler/objectivec/helpers.h" #include "google/protobuf/io/printer.h" namespace google { @@ -71,7 +71,7 @@ const char* PrimitiveTypeName(const FieldDescriptor* descriptor) { case OBJECTIVECTYPE_ENUM: return "int32_t"; case OBJECTIVECTYPE_MESSAGE: - return NULL; // Messages go through objectivec_message_field.cc|h. + return NULL; // Messages go through message_field.cc|h. } // Some compilers report reaching end of function even though all cases of @@ -104,7 +104,7 @@ const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) { case OBJECTIVECTYPE_ENUM: return "Enum"; case OBJECTIVECTYPE_MESSAGE: - // Want NSArray (but goes through objectivec_message_field.cc|h). + // Want NSArray (but goes through message_field.cc|h). return ""; } diff --git a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h b/src/google/protobuf/compiler/objectivec/primitive_field.h similarity index 98% rename from src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h rename to src/google/protobuf/compiler/objectivec/primitive_field.h index 8948b4809168..904cd65b4ad2 100644 --- a/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h +++ b/src/google/protobuf/compiler/objectivec/primitive_field.h @@ -31,7 +31,7 @@ #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__ #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_PRIMITIVE_FIELD_H__ -#include "google/protobuf/compiler/objectivec/objectivec_field.h" +#include "google/protobuf/compiler/objectivec/field.h" namespace google { namespace protobuf {