Skip to content

Commit

Permalink
Merge branch 'protocolbuffers:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
marjoleinheyndrickx authored Aug 11, 2022
2 parents b136ee3 + ed5c57a commit 8177cd0
Show file tree
Hide file tree
Showing 296 changed files with 6,103 additions and 11,340 deletions.
26 changes: 0 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# autogen.sh-generated files
Makefile.in
src/Makefile.in
config.guess
config.h.in
config.sub
configure
depcomp
install-sh
ltmain.sh
missing
configure~

aclocal.m4
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
autom4te.cache

# CMake-generated files
.ninja_deps
.ninja_logs
Expand All @@ -40,8 +19,6 @@ Testing/Temporary/*
/gmock

# in-tree configure-generated files
Makefile
src/Makefile
/config.h
config.log
config.status
Expand All @@ -56,7 +33,6 @@ stamp-h1
*.o
*.lo
*.la
src/.libs
*.so
*.a

Expand All @@ -79,8 +55,6 @@ python/build/
python/docs/_build/

src/js_embed
src/protoc
src/unittest_proto_middleman

# vim generated
*.swp
Expand Down
143 changes: 104 additions & 39 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_java//java:defs.bzl", "java_binary", "java_lite_proto_library", "java_proto_library")
load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS", "PROTOC_LINK_OPTS")
load(":protobuf.bzl", "py_proto_library")
load(":protobuf.bzl", "internal_py_proto_library", "internal_php_proto_library", "internal_ruby_proto_library", "internal_objc_proto_library")

licenses(["notice"])

Expand Down Expand Up @@ -145,6 +145,16 @@ filegroup(
visibility = ["//visibility:public"],
)

internal_ruby_proto_library(
name = "well_known_ruby_protos",
srcs = [":well_known_protos"],
includes = ["src"],
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

################################################################################
# Protocol Buffers Compiler
################################################################################
Expand Down Expand Up @@ -302,6 +312,10 @@ proto_lang_toolchain(
visibility = ["//visibility:public"],
)

################################################################################
# Objective-C support
################################################################################

alias(
name = "objectivec",
actual = "//objectivec",
Expand Down Expand Up @@ -355,7 +369,7 @@ proto_library(
deps = ["//src/google/protobuf:generic_test_protos"],
)

py_proto_library(
internal_py_proto_library(
name = "generated_protos_py",
testonly = 1,
srcs = [":generated_protos"],
Expand All @@ -368,22 +382,22 @@ py_proto_library(
# Conformance tests
################################################################################

alias(
name = "conformance_test_runner",
actual = "//conformance:conformance_test_runner",
visibility = ["//visibility:public"],
)

alias(
name = "test_messages_proto2_proto",
actual = "//src/google/protobuf:test_messages_proto2_proto", # proto_library
visibility = ["//visibility:public"],
cc_proto_library(
name = "test_messages_proto2_cc_proto",
visibility = [
"//conformance:__pkg__",
"//src:__subpackages__",
],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

alias(
name = "test_messages_proto3_proto",
actual = "//src/google/protobuf:test_messages_proto3_proto", # proto_library
visibility = ["//visibility:public"],
cc_proto_library(
name = "test_messages_proto3_cc_proto",
visibility = [
"//conformance:__pkg__",
"//src:__subpackages__",
],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

java_proto_library(
Expand All @@ -392,7 +406,7 @@ java_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto2_proto"],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

java_proto_library(
Expand All @@ -401,7 +415,7 @@ java_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto3_proto"],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

java_lite_proto_library(
Expand All @@ -410,7 +424,7 @@ java_lite_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto2_proto"],
deps = ["//src/google/protobuf:test_messages_proto2_proto"],
)

java_lite_proto_library(
Expand All @@ -419,7 +433,77 @@ java_lite_proto_library(
"//conformance:__pkg__",
"//java:__subpackages__",
],
deps = [":test_messages_proto3_proto"],
deps = ["//src/google/protobuf:test_messages_proto3_proto"],
)

internal_objc_proto_library(
name = "test_messages_proto2_objc_proto",
srcs = ["//src/google/protobuf:test_messages_proto2.proto"],
includes = ["src/google/protobuf"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//objectivec:__subpackages__",
],
)

internal_objc_proto_library(
name = "test_messages_proto3_objc_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//objectivec:__subpackages__",
],
)

internal_php_proto_library(
name = "test_messages_proto3_php_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
outs = [
"Protobuf_test_messages/Proto3/EnumOnlyProto3.php",
"Protobuf_test_messages/Proto3/EnumOnlyProto3/PBBool.php",
"Protobuf_test_messages/Proto3/ForeignEnum.php",
"Protobuf_test_messages/Proto3/ForeignMessage.php",
"Protobuf_test_messages/Proto3/NullHypothesisProto3.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/AliasedEnum.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedEnum.php",
"Protobuf_test_messages/Proto3/TestAllTypesProto3/NestedMessage.php",
"GPBMetadata/TestMessagesProto3.php",
],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//php:__subpackages__",
],
)

internal_ruby_proto_library(
name = "test_messages_proto2_ruby_proto",
srcs = ["//src/google/protobuf:test_messages_proto2.proto"],
includes = ["src/google/protobuf"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

internal_ruby_proto_library(
name = "test_messages_proto3_ruby_proto",
srcs = ["//src/google/protobuf:test_messages_proto3.proto"],
proto_deps = [":well_known_protos"],
includes = ["src/google/protobuf", "src"],
testonly = 1,
visibility = [
"//conformance:__pkg__",
"//ruby:__subpackages__",
],
)

filegroup(
Expand All @@ -441,22 +525,6 @@ pkg_files(
"cmake/*.cmake",
"cmake/*.in",
"editors/*",

# Several of these files are generated by autogen.sh, so using
# glob() lets us ignore them if they are missing. (This is not good
# practice, though.)
"Makefile.in",
"aclocal.m4",
"ar-lib",
"compile",
"config*",
"depcomp",
"install-sh",
"ltmain.sh",
"m4/*.m4",
"missing",
"protobuf*.pc.in",
"test-driver",
],
allow_empty = True,
) + [
Expand All @@ -465,18 +533,15 @@ pkg_files(
"CMakeLists.txt",
"CONTRIBUTORS.txt",
"LICENSE",
"Makefile.am",
"README.md",
"WORKSPACE",
"autogen.sh",
"cmake/CMakeLists.txt",
"cmake/README.md",
"cmake/update_file_lists.sh",
"generate_descriptor_proto.sh",
"maven_install.json",
"//third_party:BUILD.bazel",
"//third_party:zlib.BUILD",
"//util/python:BUILD.bazel",
],
strip_prefix = strip_prefix.from_root(""),
visibility = ["//pkg:__pkg__"],
Expand Down
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Added a default implementation of MessageDifferencer::Reporter methods.
* proto2::MapPair is now an alias to std::pair.
* Hide C++ RepeatedField::UnsafeArenaSwap
* Use table-driven parser for reflection based objects.

Kotlin
* Suppress deprecation warnings in Kotlin generated code.
Expand Down
22 changes: 5 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,18 @@ mark_as_advanced(protobuf_DEBUG_POSTFIX)
# User options
include(${protobuf_SOURCE_DIR}/cmake/protobuf-options.cmake)

# Version metadata
set(protobuf_VERSION_STRING "3.21.4")
set(protobuf_DESCRIPTION "Protocol Buffers")
set(protobuf_CONTACT "[email protected]")

# Overrides for option dependencies
if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
set(protobuf_BUILD_LIBPROTOC ON)
endif ()
if (NOT protobuf_BUILD_PROTOBUF_BINARIES)
set(protobuf_INSTALL OFF)
endif()
# Path to main configure script
set(protobuf_CONFIGURE_SCRIPT "${protobuf_SOURCE_DIR}/configure.ac")

# Parse configure script
set(protobuf_AC_INIT_REGEX
"^AC_INIT\\(\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\],\\[([^]]+)\\]\\)$")
file(STRINGS "${protobuf_CONFIGURE_SCRIPT}" protobuf_AC_INIT_LINE
LIMIT_COUNT 1 REGEX "^AC_INIT")
# Description
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\1"
protobuf_DESCRIPTION "${protobuf_AC_INIT_LINE}")
# Version
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\2"
protobuf_VERSION_STRING "${protobuf_AC_INIT_LINE}")
# Contact
string(REGEX REPLACE "${protobuf_AC_INIT_REGEX}" "\\3"
protobuf_CONTACT "${protobuf_AC_INIT_LINE}")
# Parse version tweaks
set(protobuf_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$")
string(REGEX REPLACE "${protobuf_VERSION_REGEX}" "\\1"
Expand Down
Loading

0 comments on commit 8177cd0

Please sign in to comment.