Skip to content

Commit

Permalink
[ObjC] rename the file to drop the "objectivec_" prefix.
Browse files Browse the repository at this point in the history
Since "names.(h|cc)" now exists, drop the prefixing on all the files.
  • Loading branch information
thomasvl committed Oct 4, 2022
1 parent f093050 commit 53d8b03
Show file tree
Hide file tree
Showing 35 changed files with 113 additions and 114 deletions.
2 changes: 1 addition & 1 deletion objectivec/DevTools/check_version_stamps.sh
Expand Up @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions objectivec/GPBDescriptor.m
Expand Up @@ -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];

Expand Down Expand Up @@ -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];
Expand Down
11 changes: 5 additions & 6 deletions objectivec/Tests/GPBMessageTests.m
Expand Up @@ -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.
Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
52 changes: 26 additions & 26 deletions src/file_lists.cmake
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/main.cc
Expand Up @@ -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"
Expand Down
52 changes: 26 additions & 26 deletions src/google/protobuf/compiler/objectivec/BUILD.bazel
Expand Up @@ -21,7 +21,7 @@ cc_library(
name = "names_internal",
hdrs = [
"names.h",
"objectivec_nsobject_methods.h",
"nsobject_methods.h",
],
srcs = [
"names.cc",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
Expand Up @@ -28,15 +28,15 @@
// (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 <algorithm>
#include <map>
#include <string>

#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 {
Expand Down
Expand Up @@ -31,8 +31,8 @@
#include <map>
#include <string>

#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 {
Expand Down
Expand Up @@ -33,7 +33,7 @@

#include <map>
#include <string>
#include "google/protobuf/compiler/objectivec/objectivec_field.h"
#include "google/protobuf/compiler/objectivec/field.h"

namespace google {
namespace protobuf {
Expand Down
Expand Up @@ -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 <iostream>

#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"

Expand Down
Expand Up @@ -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 <iostream>

#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 {
Expand Down
Expand Up @@ -28,18 +28,18 @@
// (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 <algorithm>
#include <iostream>
#include <sstream>

#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
Expand Down
Expand Up @@ -35,7 +35,7 @@
#include <unordered_map>
#include <unordered_set>
#include <vector>
#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"

Expand Down
Expand Up @@ -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 <fstream>
#include <iostream>
Expand All @@ -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"

Expand Down
Expand Up @@ -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 <gtest/gtest.h>

Expand Down
Expand Up @@ -31,8 +31,8 @@
#include <map>
#include <string>

#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 {
Expand Down
Expand Up @@ -34,7 +34,7 @@
#include <map>
#include <string>

#include "google/protobuf/compiler/objectivec/objectivec_field.h"
#include "google/protobuf/compiler/objectivec/field.h"

namespace google {
namespace protobuf {
Expand Down
Expand Up @@ -28,17 +28,17 @@
// (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 <algorithm>
#include <iostream>
#include <sstream>

#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"

Expand Down

0 comments on commit 53d8b03

Please sign in to comment.