Sync from Piper @441896533
PROTOBUF_SYNC_PIPER
This commit is contained in:
commit
9e09343a49
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -16,7 +16,7 @@ Stack Overflow is also a useful if unofficial resource https://stackoverflow.com
|
||||
-->
|
||||
|
||||
**What version of protobuf and what language are you using?**
|
||||
Version: master/v3.6.0/v3.5.0 etc.
|
||||
Version: main/v3.6.0/v3.5.0 etc.
|
||||
Language: C++/Java/Python/C#/Ruby/PHP/Objective-C/Javascript
|
||||
|
||||
**What operating system (Linux, Windows, ...) and version?**
|
||||
|
43
.github/workflows/php-ext.yml
vendored
Normal file
43
.github/workflows/php-ext.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: PHP extension
|
||||
|
||||
on:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
build-php:
|
||||
name: Build PHP extension
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.php-image }}
|
||||
strategy:
|
||||
matrix:
|
||||
php-image:
|
||||
- php:7.4-cli
|
||||
- php:8.1-cli
|
||||
steps:
|
||||
- name: Install git
|
||||
run: |
|
||||
apt-get update -q
|
||||
apt-get install -qy --no-install-recommends git
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Prepare source code
|
||||
run: |
|
||||
rm -rf "$GITHUB_WORKSPACE/php/ext/google/protobuf/third_party"
|
||||
cp -r "$GITHUB_WORKSPACE/third_party" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
|
||||
cp "$GITHUB_WORKSPACE/LICENSE" "$GITHUB_WORKSPACE/php/ext/google/protobuf"
|
||||
- name: Create package
|
||||
run: |
|
||||
cd /tmp
|
||||
rm -rf protobuf-*.tgz
|
||||
pecl package "$GITHUB_WORKSPACE/php/ext/google/protobuf/package.xml"
|
||||
- name: Compile extension
|
||||
run: |
|
||||
cd /tmp
|
||||
MAKE="make -j$(nproc)" pecl install protobuf-*.tgz
|
||||
- name: Enable extension
|
||||
run: docker-php-ext-enable protobuf
|
||||
- name: Inspect extension
|
||||
run: php --ri protobuf
|
@ -1,3 +1,11 @@
|
||||
2022-04-05 version 3.20.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
|
||||
|
||||
PHP
|
||||
* Fix building packaged PHP extension (#9727)
|
||||
|
||||
Other
|
||||
* Fix versioning issues in 3.20.0
|
||||
|
||||
Unreleased Changes
|
||||
|
||||
C++
|
||||
|
@ -53,11 +53,11 @@ conforming.
|
||||
|
||||
## Contributing Process
|
||||
|
||||
Most pull requests should go to the master branch and the change will be
|
||||
Most pull requests should go to the main branch and the change will be
|
||||
included in the next major/minor version release (e.g., 3.6.0 release). If you
|
||||
need to include a bug fix in a patch release (e.g., 3.5.2), make sure it’s
|
||||
already merged to master, and then create a pull request cherry-picking the
|
||||
commits from master branch to the release branch (e.g., branch 3.5.x).
|
||||
already merged to main, and then create a pull request cherry-picking the
|
||||
commits from main branch to the release branch (e.g., branch 3.5.x).
|
||||
|
||||
For each pull request, a protobuf team member will be assigned to review the
|
||||
pull request. For minor cleanups, the pull request may be merged right away
|
||||
@ -96,9 +96,9 @@ the final release.
|
||||
of inactivity.
|
||||
* Maintain clean commit history and use meaningful commit messages. PRs with
|
||||
messy commit history are difficult to review and won't be merged. Use rebase
|
||||
-i upstream/master to curate your commit history and/or to bring in latest
|
||||
changes from master (but avoid rebasing in the middle of a code review).
|
||||
* Keep your PR up to date with upstream/master (if there are merge conflicts,
|
||||
-i upstream/main to curate your commit history and/or to bring in latest
|
||||
changes from main (but avoid rebasing in the middle of a code review).
|
||||
* Keep your PR up to date with upstream/main (if there are merge conflicts,
|
||||
we can't really merge your change).
|
||||
* All tests need to be passing before your change can be merged. We recommend
|
||||
you run tests locally before creating your PR to catch breakages early on.
|
||||
|
@ -50,6 +50,7 @@ pkgconfig_DATA = protobuf.pc protobuf-lite.pc
|
||||
|
||||
csharp_EXTRA_DIST= \
|
||||
global.json \
|
||||
csharp/.editorconfig \
|
||||
csharp/.gitignore \
|
||||
csharp/CHANGES.txt \
|
||||
csharp/Google.Protobuf.Tools.targets \
|
||||
|
@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Protobuf-C++'
|
||||
s.version = '3.20.0-rc1'
|
||||
s.version = '3.20.1-rc1'
|
||||
s.summary = 'Protocol Buffers v3 runtime library for C++.'
|
||||
s.homepage = 'https://github.com/google/protobuf'
|
||||
s.license = 'BSD-3-Clause'
|
||||
|
@ -5,7 +5,7 @@
|
||||
# dependent projects use the :git notation to refer to the library.
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'Protobuf'
|
||||
s.version = '3.20.0'
|
||||
s.version = '3.20.1-rc1'
|
||||
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
|
||||
s.homepage = 'https://github.com/protocolbuffers/protobuf'
|
||||
s.license = 'BSD-3-Clause'
|
||||
|
@ -38,7 +38,7 @@ page, check out the maven repo here:
|
||||
[https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/)
|
||||
|
||||
These pre-built binaries are only provided for released versions. If you want
|
||||
to use the github master version at HEAD, or you need to modify protobuf code,
|
||||
to use the github main version at HEAD, or you need to modify protobuf code,
|
||||
or you are using C++, it's recommended to build your own protoc binary from
|
||||
source.
|
||||
|
||||
|
@ -13,131 +13,130 @@ mkdir include\google\protobuf\compiler\ruby
|
||||
mkdir include\google\protobuf\io
|
||||
mkdir include\google\protobuf\stubs
|
||||
mkdir include\google\protobuf\util
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\any.h" include\google\protobuf\any.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\any.pb.h" include\google\protobuf\any.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\api.pb.h" include\google\protobuf\api.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\arena.h" include\google\protobuf\arena.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\arena_impl.h" include\google\protobuf\arena_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\arenastring.h" include\google\protobuf\arenastring.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\arenaz_sampler.h" include\google\protobuf\arenaz_sampler.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\code_generator.h" include\google\protobuf\compiler\code_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\command_line_interface.h" include\google\protobuf\compiler\command_line_interface.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\cpp\file.h" include\google\protobuf\compiler\cpp\cpp_file.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\cpp\generator.h" include\google\protobuf\compiler\cpp\cpp_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\cpp\helpers.h" include\google\protobuf\compiler\cpp\cpp_helpers.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\cpp\names.h" include\google\protobuf\compiler\cpp\cpp_names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\csharp\csharp_doc_comment.h" include\google\protobuf\compiler\csharp\csharp_doc_comment.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\csharp\csharp_generator.h" include\google\protobuf\compiler\csharp\csharp_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\csharp\csharp_names.h" include\google\protobuf\compiler\csharp\csharp_names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\csharp\csharp_options.h" include\google\protobuf\compiler\csharp\csharp_options.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\importer.h" include\google\protobuf\compiler\importer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\java\generator.h" include\google\protobuf\compiler\java\java_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\java\kotlin_generator.h" include\google\protobuf\compiler\java\java_kotlin_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\java\names.h" include\google\protobuf\compiler\java\java_names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\js\js_generator.h" include\google\protobuf\compiler\js\js_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\objectivec\objectivec_generator.h" include\google\protobuf\compiler\objectivec\objectivec_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\objectivec\objectivec_helpers.h" include\google\protobuf\compiler\objectivec\objectivec_helpers.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\parser.h" include\google\protobuf\compiler\parser.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\php\php_generator.h" include\google\protobuf\compiler\php\php_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\plugin.h" include\google\protobuf\compiler\plugin.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\plugin.pb.h" include\google\protobuf\compiler\plugin.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\python\generator.h" include\google\protobuf\compiler\python\python_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\python\pyi_generator.h" include\google\protobuf\compiler\python\python_pyi_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\python\helpers.h" include\google\protobuf\compiler\python\python_helpers.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\ruby\ruby_generator.h" include\google\protobuf\compiler\ruby\ruby_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\descriptor.h" include\google\protobuf\descriptor.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\descriptor.pb.h" include\google\protobuf\descriptor.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\descriptor_database.h" include\google\protobuf\descriptor_database.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\duration.pb.h" include\google\protobuf\duration.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\dynamic_message.h" include\google\protobuf\dynamic_message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\empty.pb.h" include\google\protobuf\empty.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\explicitly_constructed.h" include\google\protobuf\explicitly_constructed.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\extension_set.h" include\google\protobuf\extension_set.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\extension_set_inl.h" include\google\protobuf\extension_set_inl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\field_access_listener.h" include\google\protobuf\field_access_listener.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\field_mask.pb.h" include\google\protobuf\field_mask.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_message_bases.h" include\google\protobuf\generated_message_bases.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_message_tctable_decl.h" include\google\protobuf\generated_message_tctable_decl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_message_tctable_impl.h" include\google\protobuf\generated_message_tctable_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\printer.h" include\google\protobuf\io\printer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\strtod.h" include\google\protobuf\io\strtod.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\tokenizer.h" include\google\protobuf\io\tokenizer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\zero_copy_stream.h" include\google\protobuf\io\zero_copy_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\zero_copy_stream_impl.h" include\google\protobuf\io\zero_copy_stream_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\io\zero_copy_stream_impl_lite.h" include\google\protobuf\io\zero_copy_stream_impl_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map.h" include\google\protobuf\map.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_entry.h" include\google\protobuf\map_entry.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_entry_lite.h" include\google\protobuf\map_entry_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_field.h" include\google\protobuf\map_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_field_inl.h" include\google\protobuf\map_field_inl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_field_lite.h" include\google\protobuf\map_field_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\map_type_handler.h" include\google\protobuf\map_type_handler.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\message.h" include\google\protobuf\message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\message_lite.h" include\google\protobuf\message_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\metadata.h" include\google\protobuf\metadata.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\metadata_lite.h" include\google\protobuf\metadata_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\parse_context.h" include\google\protobuf\parse_context.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\port.h" include\google\protobuf\port.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\port_def.inc" include\google\protobuf\port_def.inc
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\port_undef.inc" include\google\protobuf\port_undef.inc
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\reflection.h" include\google\protobuf\reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\reflection_ops.h" include\google\protobuf\reflection_ops.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\repeated_field.h" include\google\protobuf\repeated_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\repeated_ptr_field.h" include\google\protobuf\repeated_ptr_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\service.h" include\google\protobuf\service.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\source_context.pb.h" include\google\protobuf\source_context.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\struct.pb.h" include\google\protobuf\struct.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\bytestream.h" include\google\protobuf\stubs\bytestream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\map_util.h" include\google\protobuf\stubs\map_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\once.h" include\google\protobuf\stubs\once.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\platform_macros.h" include\google\protobuf\stubs\platform_macros.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\stringpiece.h" include\google\protobuf\stubs\stringpiece.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\text_format.h" include\google\protobuf\text_format.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\timestamp.pb.h" include\google\protobuf\timestamp.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\type.pb.h" include\google\protobuf\type.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\unknown_field_set.h" include\google\protobuf\unknown_field_set.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\delimited_message_util.h" include\google\protobuf\util\delimited_message_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\field_comparator.h" include\google\protobuf\util\field_comparator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\field_mask_util.h" include\google\protobuf\util\field_mask_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\json_util.h" include\google\protobuf\util\json_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\message_differencer.h" include\google\protobuf\util\message_differencer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\time_util.h" include\google\protobuf\util\time_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\type_resolver.h" include\google\protobuf\util\type_resolver.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\util\type_resolver_util.h" include\google\protobuf\util\type_resolver_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\wire_format.h" include\google\protobuf\wire_format.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\wire_format_lite.h" include\google\protobuf\wire_format_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\wrappers.pb.h" include\google\protobuf\wrappers.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\any.proto" include\google\protobuf\any.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\api.proto" include\google\protobuf\api.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\compiler\plugin.proto" include\google\protobuf\compiler\plugin.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\descriptor.proto" include\google\protobuf\descriptor.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\duration.proto" include\google\protobuf\duration.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\empty.proto" include\google\protobuf\empty.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\field_mask.proto" include\google\protobuf\field_mask.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\source_context.proto" include\google\protobuf\source_context.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\struct.proto" include\google\protobuf\struct.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\timestamp.proto" include\google\protobuf\timestamp.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\type.proto" include\google\protobuf\type.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\src\google\protobuf\wrappers.proto" include\google\protobuf\wrappers.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.h" include\google\protobuf\any.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.pb.h" include\google\protobuf\any.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.pb.h" include\google\protobuf\api.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena.h" include\google\protobuf\arena.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arena_impl.h" include\google\protobuf\arena_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arenastring.h" include\google\protobuf\arenastring.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\arenaz_sampler.h" include\google\protobuf\arenaz_sampler.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\code_generator.h" include\google\protobuf\compiler\code_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\command_line_interface.h" include\google\protobuf\compiler\command_line_interface.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\file.h" include\google\protobuf\compiler\cpp\file.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\generator.h" include\google\protobuf\compiler\cpp\generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\helpers.h" include\google\protobuf\compiler\cpp\helpers.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\cpp\names.h" include\google\protobuf\compiler\cpp\names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_doc_comment.h" include\google\protobuf\compiler\csharp\csharp_doc_comment.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_generator.h" include\google\protobuf\compiler\csharp\csharp_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_names.h" include\google\protobuf\compiler\csharp\csharp_names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\csharp\csharp_options.h" include\google\protobuf\compiler\csharp\csharp_options.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\importer.h" include\google\protobuf\compiler\importer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\generator.h" include\google\protobuf\compiler\java\generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\kotlin_generator.h" include\google\protobuf\compiler\java\kotlin_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\java\names.h" include\google\protobuf\compiler\java\names.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\js\js_generator.h" include\google\protobuf\compiler\js\js_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_generator.h" include\google\protobuf\compiler\objectivec\objectivec_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\objectivec\objectivec_helpers.h" include\google\protobuf\compiler\objectivec\objectivec_helpers.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\parser.h" include\google\protobuf\compiler\parser.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\php\php_generator.h" include\google\protobuf\compiler\php\php_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.h" include\google\protobuf\compiler\plugin.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.pb.h" include\google\protobuf\compiler\plugin.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\python\generator.h" include\google\protobuf\compiler\python\generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\python\pyi_generator.h" include\google\protobuf\compiler\python\pyi_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\ruby\ruby_generator.h" include\google\protobuf\compiler\ruby\ruby_generator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.h" include\google\protobuf\descriptor.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.pb.h" include\google\protobuf\descriptor.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor_database.h" include\google\protobuf\descriptor_database.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.pb.h" include\google\protobuf\duration.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\dynamic_message.h" include\google\protobuf\dynamic_message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.pb.h" include\google\protobuf\empty.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\explicitly_constructed.h" include\google\protobuf\explicitly_constructed.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set.h" include\google\protobuf\extension_set.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\extension_set_inl.h" include\google\protobuf\extension_set_inl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_access_listener.h" include\google\protobuf\field_access_listener.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.pb.h" include\google\protobuf\field_mask.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_reflection.h" include\google\protobuf\generated_enum_reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_enum_util.h" include\google\protobuf\generated_enum_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_bases.h" include\google\protobuf\generated_message_bases.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_reflection.h" include\google\protobuf\generated_message_reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_decl.h" include\google\protobuf\generated_message_tctable_decl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tctable_impl.h" include\google\protobuf\generated_message_tctable_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\printer.h" include\google\protobuf\io\printer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\strtod.h" include\google\protobuf\io\strtod.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\tokenizer.h" include\google\protobuf\io\tokenizer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream.h" include\google\protobuf\io\zero_copy_stream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl.h" include\google\protobuf\io\zero_copy_stream_impl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\zero_copy_stream_impl_lite.h" include\google\protobuf\io\zero_copy_stream_impl_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map.h" include\google\protobuf\map.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry.h" include\google\protobuf\map_entry.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_entry_lite.h" include\google\protobuf\map_entry_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field.h" include\google\protobuf\map_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_inl.h" include\google\protobuf\map_field_inl.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_field_lite.h" include\google\protobuf\map_field_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\map_type_handler.h" include\google\protobuf\map_type_handler.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message.h" include\google\protobuf\message.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\message_lite.h" include\google\protobuf\message_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata.h" include\google\protobuf\metadata.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\metadata_lite.h" include\google\protobuf\metadata_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\parse_context.h" include\google\protobuf\parse_context.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port.h" include\google\protobuf\port.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port_def.inc" include\google\protobuf\port_def.inc
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\port_undef.inc" include\google\protobuf\port_undef.inc
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection.h" include\google\protobuf\reflection.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\reflection_ops.h" include\google\protobuf\reflection_ops.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_field.h" include\google\protobuf\repeated_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\repeated_ptr_field.h" include\google\protobuf\repeated_ptr_field.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\service.h" include\google\protobuf\service.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\source_context.pb.h" include\google\protobuf\source_context.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\struct.pb.h" include\google\protobuf\struct.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" include\google\protobuf\stubs\bytestream.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\map_util.h" include\google\protobuf\stubs\map_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\mutex.h" include\google\protobuf\stubs\mutex.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\once.h" include\google\protobuf\stubs\once.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\platform_macros.h" include\google\protobuf\stubs\platform_macros.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\port.h" include\google\protobuf\stubs\port.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\status.h" include\google\protobuf\stubs\status.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stl_util.h" include\google\protobuf\stubs\stl_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\stringpiece.h" include\google\protobuf\stubs\stringpiece.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\strutil.h" include\google\protobuf\stubs\strutil.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\template_util.h" include\google\protobuf\stubs\template_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\text_format.h" include\google\protobuf\text_format.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.pb.h" include\google\protobuf\timestamp.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.pb.h" include\google\protobuf\type.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\unknown_field_set.h" include\google\protobuf\unknown_field_set.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\delimited_message_util.h" include\google\protobuf\util\delimited_message_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_comparator.h" include\google\protobuf\util\field_comparator.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\field_mask_util.h" include\google\protobuf\util\field_mask_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\json_util.h" include\google\protobuf\util\json_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\message_differencer.h" include\google\protobuf\util\message_differencer.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\time_util.h" include\google\protobuf\util\time_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver.h" include\google\protobuf\util\type_resolver.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\util\type_resolver_util.h" include\google\protobuf\util\type_resolver_util.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format.h" include\google\protobuf\wire_format.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wire_format_lite.h" include\google\protobuf\wire_format_lite.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.pb.h" include\google\protobuf\wrappers.pb.h
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\any.proto" include\google\protobuf\any.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\api.proto" include\google\protobuf\api.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\compiler\plugin.proto" include\google\protobuf\compiler\plugin.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\descriptor.proto" include\google\protobuf\descriptor.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\duration.proto" include\google\protobuf\duration.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\empty.proto" include\google\protobuf\empty.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\field_mask.proto" include\google\protobuf\field_mask.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\source_context.proto" include\google\protobuf\source_context.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\struct.proto" include\google\protobuf\struct.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\timestamp.proto" include\google\protobuf\timestamp.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\type.proto" include\google\protobuf\type.proto
|
||||
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\wrappers.proto" include\google\protobuf\wrappers.proto
|
||||
|
@ -39,6 +39,7 @@ set(libprotobuf_lite_includes
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/arena_impl.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/arenastring.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/arenaz_sampler.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/endian.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/explicitly_constructed.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/extension_set_inl.h
|
||||
|
@ -20,7 +20,6 @@ set(libprotobuf_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/io/tokenizer.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/map_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/message.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/reflection_internal.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/reflection_ops.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/service.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.cc
|
||||
@ -79,6 +78,7 @@ set(libprotobuf_includes
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/message.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/metadata.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/reflection.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/reflection_internal.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/reflection_ops.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/service.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/source_context.pb.h
|
||||
|
@ -36,7 +36,6 @@ set(libprotoc_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/doc_comment.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/enum.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/enum_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/enum_field.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/enum_field_lite.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/enum_lite.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/java/extension.cc
|
||||
@ -65,28 +64,17 @@ set(libprotoc_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/js/js_generator.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/js/well_known_types_embed.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_extension.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_field.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_file.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_file.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_generator.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_map_field.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
|
||||
${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.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_oneof.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/objectivec/objectivec_primitive_field.h
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/php/php_generator.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/plugin.pb.cc
|
||||
@ -96,7 +84,6 @@ set(libprotoc_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/ruby/ruby_generator.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/subprocess.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/zip_writer.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/zip_writer.h
|
||||
)
|
||||
|
||||
set(libprotoc_headers
|
||||
|
@ -1,5 +1,7 @@
|
||||
option(protobuf_USE_EXTERNAL_GTEST "Use external Google Test (i.e. not the one in third_party/googletest)" OFF)
|
||||
|
||||
option(protobuf_TEST_XML_OUTDIR "Output directory for XML logs from tests." "")
|
||||
|
||||
option(protobuf_ABSOLUTE_TEST_PLUGIN_PATH
|
||||
"Using absolute test_plugin path in tests" ON)
|
||||
mark_as_advanced(protobuf_ABSOLUTE_TEST_PLUGIN_PATH)
|
||||
@ -56,6 +58,7 @@ set(tests_protos
|
||||
google/protobuf/unittest_drop_unknown_fields.proto
|
||||
google/protobuf/unittest_embed_optimize_for.proto
|
||||
google/protobuf/unittest_empty.proto
|
||||
google/protobuf/unittest_enormous_descriptor.proto
|
||||
google/protobuf/unittest_import.proto
|
||||
google/protobuf/unittest_import_public.proto
|
||||
google/protobuf/unittest_lazy_dependencies.proto
|
||||
@ -126,6 +129,10 @@ set(common_lite_test_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/test_util_lite.cc
|
||||
)
|
||||
|
||||
add_library(protobuf-lite-test-common STATIC
|
||||
${common_lite_test_files} ${lite_test_proto_files})
|
||||
target_link_libraries(protobuf-lite-test-common libprotobuf-lite GTest::gmock)
|
||||
|
||||
set(common_test_files
|
||||
${common_lite_test_files}
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/mock_code_generator.cc
|
||||
@ -136,6 +143,10 @@ set(common_test_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/testing/googletest.cc
|
||||
)
|
||||
|
||||
add_library(protobuf-test-common STATIC
|
||||
${common_test_files} ${tests_proto_files})
|
||||
target_link_libraries(protobuf-test-common libprotobuf GTest::gmock)
|
||||
|
||||
set(tests_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/any_test.cc
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/arena_unittest.cc
|
||||
@ -233,13 +244,20 @@ if(MINGW)
|
||||
|
||||
endif()
|
||||
|
||||
add_executable(tests ${tests_files} ${common_test_files} ${tests_proto_files} ${lite_test_proto_files})
|
||||
if(protobuf_TEST_XML_OUTDIR)
|
||||
if(NOT "${protobuf_TEST_XML_OUTDIR}" MATCHES "[/\\]$")
|
||||
string(APPEND protobuf_TEST_XML_OUTDIR "/")
|
||||
endif()
|
||||
set(protobuf_GTEST_ARGS "--gtest_output=xml:${protobuf_TEST_XML_OUTDIR}")
|
||||
endif()
|
||||
|
||||
add_executable(tests ${tests_files})
|
||||
if (MSVC)
|
||||
target_compile_options(tests PRIVATE
|
||||
/wd4146 # unary minus operator applied to unsigned type, result still unsigned
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(tests libprotoc libprotobuf GTest::gmock_main)
|
||||
target_link_libraries(tests protobuf-lite-test-common protobuf-test-common libprotoc libprotobuf GTest::gmock_main)
|
||||
|
||||
set(test_plugin_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/compiler/mock_code_generator.cc
|
||||
@ -254,14 +272,20 @@ target_link_libraries(test_plugin libprotoc libprotobuf GTest::gmock)
|
||||
set(lite_test_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/lite_unittest.cc
|
||||
)
|
||||
add_executable(lite-test ${lite_test_files} ${common_lite_test_files} ${lite_test_proto_files})
|
||||
target_link_libraries(lite-test libprotobuf-lite GTest::gmock_main)
|
||||
add_executable(lite-test ${lite_test_files})
|
||||
target_link_libraries(lite-test protobuf-lite-test-common libprotobuf-lite GTest::gmock_main)
|
||||
|
||||
add_test(NAME lite-test
|
||||
COMMAND lite-test ${protobuf_GTEST_ARGS})
|
||||
|
||||
set(lite_arena_test_files
|
||||
${protobuf_SOURCE_DIR}/src/google/protobuf/lite_arena_unittest.cc
|
||||
)
|
||||
add_executable(lite-arena-test ${lite_arena_test_files} ${common_lite_test_files} ${lite_test_proto_files})
|
||||
target_link_libraries(lite-arena-test libprotobuf-lite GTest::gmock_main)
|
||||
add_executable(lite-arena-test ${lite_arena_test_files})
|
||||
target_link_libraries(lite-arena-test protobuf-lite-test-common libprotobuf-lite GTest::gmock_main)
|
||||
|
||||
add_test(NAME lite-arena-test
|
||||
COMMAND lite-arena-test ${protobuf_GTEST_ARGS})
|
||||
|
||||
add_custom_target(check
|
||||
COMMAND tests
|
||||
@ -269,5 +293,5 @@ add_custom_target(check
|
||||
WORKING_DIRECTORY ${protobuf_SOURCE_DIR})
|
||||
|
||||
add_test(NAME check
|
||||
COMMAND tests
|
||||
COMMAND tests ${protobuf_GTEST_ARGS}
|
||||
WORKING_DIRECTORY "${protobuf_SOURCE_DIR}")
|
||||
|
@ -17,7 +17,7 @@ AC_PREREQ(2.59)
|
||||
# In the SVN trunk, the version should always be the next anticipated release
|
||||
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
|
||||
# the size of one file name in the dist tarfile over the 99-char limit.)
|
||||
AC_INIT([Protocol Buffers],[3.20.0-rc-1],[protobuf@googlegroups.com],[protobuf])
|
||||
AC_INIT([Protocol Buffers],[3.20.1-rc-1],[protobuf@googlegroups.com],[protobuf])
|
||||
|
||||
AM_MAINTAINER_MODE([enable])
|
||||
|
||||
|
@ -5,10 +5,10 @@
|
||||
<title>Google Protocol Buffers tools</title>
|
||||
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
|
||||
<description>See project site for more info.</description>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc1</version>
|
||||
<authors>Google Inc.</authors>
|
||||
<owners>protobuf-packages</owners>
|
||||
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
|
||||
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/main/LICENSE</licenseUrl>
|
||||
<projectUrl>https://github.com/protocolbuffers/protobuf</projectUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<releaseNotes>Tools for Protocol Buffers</releaseNotes>
|
||||
|
@ -41,8 +41,8 @@ namespace Google.Protobuf.Benchmarks
|
||||
/// Benchmark for serializing and deserializing of standard datasets that are also
|
||||
/// measured by benchmarks in other languages.
|
||||
/// Over time we may wish to test the various different approaches to serialization and deserialization separately.
|
||||
/// See https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md
|
||||
/// See https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md
|
||||
/// See https://github.com/protocolbuffers/protobuf/blob/main/benchmarks/README.md
|
||||
/// See https://github.com/protocolbuffers/protobuf/blob/main/docs/performance.md
|
||||
/// </summary>
|
||||
[MemoryDiagnoser]
|
||||
public class GoogleMessageBenchmark
|
||||
|
@ -625,8 +625,6 @@ namespace Google.Protobuf.Collections
|
||||
output.WriteString("the_value");
|
||||
output.Flush();
|
||||
|
||||
Console.WriteLine(BitConverter.ToString(memoryStream.ToArray()));
|
||||
|
||||
var field = new MapField<string, string>();
|
||||
var mapCodec = new MapField<string, string>.Codec(FieldCodec.ForString(keyTag, ""), FieldCodec.ForString(valueTag, ""), 10);
|
||||
var input = new CodedInputStream(memoryStream.ToArray());
|
||||
|
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
|
||||
<Copyright>Copyright 2015, Google Inc.</Copyright>
|
||||
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
|
||||
<VersionPrefix>3.20.0</VersionPrefix>
|
||||
<VersionPrefix>3.20.1-rc1</VersionPrefix>
|
||||
<!-- C# 7.2 is required for Span/BufferWriter/ReadOnlySequence -->
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<Authors>Google Inc.</Authors>
|
||||
|
@ -30,7 +30,7 @@ Presence tracking was added to proto3 in response to user feedback, both from
|
||||
inside Google and [from open-source
|
||||
users](https://github.com/protocolbuffers/protobuf/issues/1606). The [proto3
|
||||
wrapper
|
||||
types](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/wrappers.proto)
|
||||
types](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/wrappers.proto)
|
||||
were previously the only supported presence mechanism for proto3. Users have
|
||||
pointed to both efficiency and usability issues with the wrapper types.
|
||||
|
||||
|
@ -4,7 +4,7 @@ Ahead Of Time (AOT) compilation build tools such as those provided by [GraalVM's
|
||||
Protobuf for the JVM uses reflection and some of its target classes are not possible to determine in advance.
|
||||
Historically, there were good reasons to use reflection based on APIs that were published effectively requiring them, and this situation is unlikely to change.
|
||||
|
||||
[The Lite version of protobuf for the JVM](https://github.com/protocolbuffers/protobuf/blob/master/java/lite.md)
|
||||
[The Lite version of protobuf for the JVM](https://github.com/protocolbuffers/protobuf/blob/main/java/lite.md)
|
||||
avoids reflection and may be better suited for use with AOT compilation tooling. This Lite version was originally targeted for use on Android which has similar AOT compilation
|
||||
goals as GraalVM's native-image tool.
|
||||
|
||||
|
@ -309,3 +309,10 @@ with info about your project (name and website) so we can add an entry for you.
|
||||
* Website: https://github.com/yeqown/protoc-gen-fieldmask
|
||||
* Extension: 1142
|
||||
|
||||
1. Google Gnostic
|
||||
* Website: https://github.com/google/gnostic
|
||||
* Extension: 1143
|
||||
|
||||
1. Protoc-gen-go-micro
|
||||
* Website: https://github.com/unistack-org/protoc-gen-go-micro
|
||||
* Extension: 1144
|
@ -301,4 +301,4 @@ This table contains the results of three separate languages:
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
\* The cpp performance can be improved by using [tcmalloc](https://gperftools.github.io/gperftools/tcmalloc.html), please follow the (instruction)[https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md] to link with tcmalloc to get the faster result.
|
||||
\* The cpp performance can be improved by using [tcmalloc](https://gperftools.github.io/gperftools/tcmalloc.html), please follow the (instruction)[https://github.com/protocolbuffers/protobuf/blob/main/benchmarks/README.md] to link with tcmalloc to get the faster result.
|
||||
|
@ -10,8 +10,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||||
#
|
||||
# http_archive(
|
||||
# name = "com_google_protobuf",
|
||||
# strip_prefix = "protobuf-master",
|
||||
# urls = ["https://github.com/protocolbuffers/protobuf/archive/master.zip"],
|
||||
# strip_prefix = "protobuf-main",
|
||||
# urls = ["https://github.com/protocolbuffers/protobuf/archive/main.zip"],
|
||||
# )
|
||||
local_repository(
|
||||
name = "com_google_protobuf",
|
||||
|
@ -23,7 +23,7 @@ If you are using Maven, use the following:
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@ -37,7 +37,7 @@ protobuf-java-util package:
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
@ -45,7 +45,7 @@ protobuf-java-util package:
|
||||
|
||||
If you are using Gradle, add the following to your `build.gradle` file's dependencies:
|
||||
```
|
||||
implementation 'com.google.protobuf:protobuf-java:3.20.0'
|
||||
implementation 'com.google.protobuf:protobuf-java:3.20.1-rc-1'
|
||||
```
|
||||
Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-bom</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Protocol Buffers [BOM]</name>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-java</artifactId>
|
||||
|
@ -336,13 +336,17 @@ public final class MapEntry<K, V> extends AbstractMessage {
|
||||
@Override
|
||||
public Builder<K, V> setField(FieldDescriptor field, Object value) {
|
||||
checkFieldDescriptor(field);
|
||||
if (value == null) {
|
||||
throw new NullPointerException(field.getFullName() + " is null");
|
||||
}
|
||||
|
||||
if (field.getNumber() == 1) {
|
||||
setKey((K) value);
|
||||
} else {
|
||||
if (field.getType() == FieldDescriptor.Type.ENUM) {
|
||||
value = ((EnumValueDescriptor) value).getNumber();
|
||||
} else if (field.getType() == FieldDescriptor.Type.MESSAGE) {
|
||||
if (value != null && !metadata.defaultValue.getClass().isInstance(value)) {
|
||||
if (!metadata.defaultValue.getClass().isInstance(value)) {
|
||||
// The value is not the exact right message type. However, if it
|
||||
// is an alternative implementation of the same type -- e.g. a
|
||||
// DynamicMessage -- we should accept it. In this case we can make
|
||||
|
@ -62,7 +62,7 @@ public final class UnknownFieldSet implements MessageLite {
|
||||
/**
|
||||
* Construct an {@code UnknownFieldSet} around the given map.
|
||||
*/
|
||||
UnknownFieldSet(TreeMap<Integer, Field> fields) {
|
||||
private UnknownFieldSet(TreeMap<Integer, Field> fields) {
|
||||
this.fields = fields;
|
||||
}
|
||||
|
||||
|
@ -1605,6 +1605,18 @@ final class Utf8 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Read bytes until 8-byte aligned so that we can read longs in the loop below.
|
||||
// Byte arrays are already either 8 or 16-byte aligned, so we just need to make sure that
|
||||
// the index (relative to the start of the array) is also 8-byte aligned. We do this by
|
||||
// ANDing the index with 7 to determine the number of bytes that need to be read before
|
||||
// we're 8-byte aligned.
|
||||
final int unaligned = 8 - ((int) offset & 7);
|
||||
for (int j = unaligned; j > 0; j--) {
|
||||
if (UnsafeUtil.getByte(bytes, offset++) < 0) {
|
||||
return unaligned - j;
|
||||
}
|
||||
}
|
||||
|
||||
int i;
|
||||
for (i = 0; i + 8 <= maxChars; i += 8) {
|
||||
if ((UnsafeUtil.getLong(bytes, UnsafeUtil.BYTE_ARRAY_BASE_OFFSET + offset)
|
||||
|
@ -59,6 +59,7 @@ import protobuf_unittest.UnittestProto.TestAllExtensions;
|
||||
import protobuf_unittest.UnittestProto.TestAllTypes;
|
||||
import protobuf_unittest.UnittestProto.TestAllTypes.NestedMessage;
|
||||
import protobuf_unittest.UnittestProto.TestAllTypesOrBuilder;
|
||||
import protobuf_unittest.UnittestProto.TestChildExtension;
|
||||
import protobuf_unittest.UnittestProto.TestExtremeDefaultValues;
|
||||
import protobuf_unittest.UnittestProto.TestOneof2;
|
||||
import protobuf_unittest.UnittestProto.TestPackedTypes;
|
||||
@ -2023,4 +2024,5 @@ public class GeneratedMessageTest {
|
||||
assertThat(builder.getRepeatedField(REPEATED_NESTED_MESSAGE_EXTENSION, 0))
|
||||
.isEqualTo(NestedMessage.newBuilder().setBb(100).build());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import com.google.protobuf.Descriptors.EnumDescriptor;
|
||||
import com.google.protobuf.Descriptors.EnumValueDescriptor;
|
||||
import com.google.protobuf.Descriptors.FieldDescriptor;
|
||||
import map_test.MapTestProto.BizarroTestMap;
|
||||
import map_test.MapTestProto.MapContainer;
|
||||
import map_test.MapTestProto.ReservedAsMapField;
|
||||
import map_test.MapTestProto.ReservedAsMapFieldWithEnumValue;
|
||||
import map_test.MapTestProto.TestMap;
|
||||
@ -1586,4 +1587,19 @@ public class MapTest {
|
||||
|
||||
assertThat(builder.build().toByteArray()).isEqualTo(new byte[0]);
|
||||
}
|
||||
|
||||
@Test
|
||||
// https://github.com/protocolbuffers/protobuf/issues/9785
|
||||
public void testContainer() {
|
||||
FieldDescriptor field = MapContainer.getDescriptor().findFieldByName("my_map");
|
||||
Descriptor entryDescriptor = field.getMessageType();
|
||||
FieldDescriptor valueDescriptor = entryDescriptor.findFieldByName("value");
|
||||
Message.Builder builder = MapContainer.newBuilder().newBuilderForField(field);
|
||||
try {
|
||||
builder.setField(valueDescriptor, null);
|
||||
fail("Allowed null field value");
|
||||
} catch (NullPointerException expected) {
|
||||
assertThat(expected).hasMessageThat().isNotNull();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ import static com.google.protobuf.UnittestLite.optionalStringExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalStringPieceExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUint32ExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUint64ExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUnverifiedLazyMessageExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedBoolExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedDoubleExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedEnumExtensionLite;
|
||||
@ -169,6 +170,7 @@ import static protobuf_unittest.UnittestProto.optionalStringExtension;
|
||||
import static protobuf_unittest.UnittestProto.optionalStringPieceExtension;
|
||||
import static protobuf_unittest.UnittestProto.optionalUint32Extension;
|
||||
import static protobuf_unittest.UnittestProto.optionalUint64Extension;
|
||||
import static protobuf_unittest.UnittestProto.optionalUnverifiedLazyMessageExtension;
|
||||
import static protobuf_unittest.UnittestProto.packedBoolExtension;
|
||||
import static protobuf_unittest.UnittestProto.packedDoubleExtension;
|
||||
import static protobuf_unittest.UnittestProto.packedEnumExtension;
|
||||
@ -343,6 +345,8 @@ public final class TestUtil {
|
||||
message.setOptionalImportMessage(ImportMessage.newBuilder().setD(120).build());
|
||||
message.setOptionalPublicImportMessage(PublicImportMessage.newBuilder().setE(126).build());
|
||||
message.setOptionalLazyMessage(TestAllTypes.NestedMessage.newBuilder().setBb(127).build());
|
||||
message.setOptionalUnverifiedLazyMessage(
|
||||
TestAllTypes.NestedMessage.newBuilder().setBb(128).build());
|
||||
|
||||
message.setOptionalNestedEnum(TestAllTypes.NestedEnum.BAZ);
|
||||
message.setOptionalForeignEnum(ForeignEnum.FOREIGN_BAZ);
|
||||
@ -1240,6 +1244,9 @@ public final class TestUtil {
|
||||
optionalPublicImportMessageExtension, PublicImportMessage.newBuilder().setE(126).build());
|
||||
message.setExtension(
|
||||
optionalLazyMessageExtension, TestAllTypes.NestedMessage.newBuilder().setBb(127).build());
|
||||
message.setExtension(
|
||||
optionalUnverifiedLazyMessageExtension,
|
||||
TestAllTypes.NestedMessage.newBuilder().setBb(128).build());
|
||||
|
||||
message.setExtension(optionalNestedEnumExtension, TestAllTypes.NestedEnum.BAZ);
|
||||
message.setExtension(optionalForeignEnumExtension, ForeignEnum.FOREIGN_BAZ);
|
||||
@ -1459,6 +1466,8 @@ public final class TestUtil {
|
||||
assertEqualsExactType(120, message.getExtension(optionalImportMessageExtension).getD());
|
||||
assertEqualsExactType(126, message.getExtension(optionalPublicImportMessageExtension).getE());
|
||||
assertEqualsExactType(127, message.getExtension(optionalLazyMessageExtension).getBb());
|
||||
assertEqualsExactType(
|
||||
128, message.getExtension(optionalUnverifiedLazyMessageExtension).getBb());
|
||||
|
||||
assertEqualsExactType(
|
||||
TestAllTypes.NestedEnum.BAZ, message.getExtension(optionalNestedEnumExtension));
|
||||
@ -2051,6 +2060,8 @@ public final class TestUtil {
|
||||
assertEqualsExactType(
|
||||
126, message.getExtension(optionalPublicImportMessageExtensionLite).getE());
|
||||
assertEqualsExactType(127, message.getExtension(optionalLazyMessageExtensionLite).getBb());
|
||||
assertEqualsExactType(
|
||||
128, message.getExtension(optionalUnverifiedLazyMessageExtensionLite).getBb());
|
||||
|
||||
assertEqualsExactType(
|
||||
TestAllTypesLite.NestedEnum.BAZ, message.getExtension(optionalNestedEnumExtensionLite));
|
||||
@ -2244,6 +2255,7 @@ public final class TestUtil {
|
||||
Assert.assertFalse(message.hasExtension(optionalImportMessageExtensionLite));
|
||||
Assert.assertFalse(message.hasExtension(optionalPublicImportMessageExtensionLite));
|
||||
Assert.assertFalse(message.hasExtension(optionalLazyMessageExtensionLite));
|
||||
Assert.assertFalse(message.hasExtension(optionalUnverifiedLazyMessageExtensionLite));
|
||||
|
||||
Assert.assertFalse(message.hasExtension(optionalNestedEnumExtensionLite));
|
||||
Assert.assertFalse(message.hasExtension(optionalForeignEnumExtensionLite));
|
||||
@ -2276,6 +2288,7 @@ public final class TestUtil {
|
||||
Assert.assertFalse(message.getExtension(optionalImportMessageExtensionLite).hasD());
|
||||
Assert.assertFalse(message.getExtension(optionalPublicImportMessageExtensionLite).hasE());
|
||||
Assert.assertFalse(message.getExtension(optionalLazyMessageExtensionLite).hasBb());
|
||||
Assert.assertFalse(message.getExtension(optionalUnverifiedLazyMessageExtensionLite).hasBb());
|
||||
|
||||
assertEqualsExactType(0, message.getExtension(optionalGroupExtensionLite).getA());
|
||||
assertEqualsExactType(0, message.getExtension(optionalNestedMessageExtensionLite).getBb());
|
||||
@ -2283,6 +2296,8 @@ public final class TestUtil {
|
||||
assertEqualsExactType(0, message.getExtension(optionalImportMessageExtensionLite).getD());
|
||||
assertEqualsExactType(0, message.getExtension(optionalPublicImportMessageExtensionLite).getE());
|
||||
assertEqualsExactType(0, message.getExtension(optionalLazyMessageExtensionLite).getBb());
|
||||
assertEqualsExactType(
|
||||
0, message.getExtension(optionalUnverifiedLazyMessageExtensionLite).getBb());
|
||||
|
||||
// Enums without defaults are set to the first value in the enum.
|
||||
assertEqualsExactType(
|
||||
@ -2850,6 +2865,11 @@ public final class TestUtil {
|
||||
message.setField(
|
||||
f("optional_lazy_message"),
|
||||
newBuilderForField(message, f("optional_lazy_message")).setField(nestedB, 127).build());
|
||||
message.setField(
|
||||
f("optional_unverified_lazy_message"),
|
||||
newBuilderForField(message, f("optional_unverified_lazy_message"))
|
||||
.setField(nestedB, 128)
|
||||
.build());
|
||||
|
||||
message.setField(f("optional_nested_enum"), nestedBaz);
|
||||
message.setField(f("optional_foreign_enum"), foreignBaz);
|
||||
@ -3100,6 +3120,9 @@ public final class TestUtil {
|
||||
126, ((Message) message.getField(f("optional_public_import_message"))).getField(importE));
|
||||
Assert.assertEquals(
|
||||
127, ((Message) message.getField(f("optional_lazy_message"))).getField(nestedB));
|
||||
Assert.assertEquals(
|
||||
128,
|
||||
((Message) message.getField(f("optional_unverified_lazy_message"))).getField(nestedB));
|
||||
|
||||
Assert.assertEquals(nestedBaz, message.getField(f("optional_nested_enum")));
|
||||
Assert.assertEquals(foreignBaz, message.getField(f("optional_foreign_enum")));
|
||||
@ -3351,6 +3374,8 @@ public final class TestUtil {
|
||||
((Message) message.getField(f("optional_public_import_message"))).hasField(importE));
|
||||
Assert.assertFalse(
|
||||
((Message) message.getField(f("optional_lazy_message"))).hasField(nestedB));
|
||||
Assert.assertFalse(
|
||||
((Message) message.getField(f("optional_unverified_lazy_message"))).hasField(nestedB));
|
||||
|
||||
Assert.assertEquals(0, ((Message) message.getField(f("optionalgroup"))).getField(groupA));
|
||||
Assert.assertEquals(
|
||||
@ -3363,6 +3388,8 @@ public final class TestUtil {
|
||||
0, ((Message) message.getField(f("optional_public_import_message"))).getField(importE));
|
||||
Assert.assertEquals(
|
||||
0, ((Message) message.getField(f("optional_lazy_message"))).getField(nestedB));
|
||||
Assert.assertEquals(
|
||||
0, ((Message) message.getField(f("optional_unverified_lazy_message"))).getField(nestedB));
|
||||
|
||||
// Enums without defaults are set to the first value in the enum.
|
||||
Assert.assertEquals(nestedFoo, message.getField(f("optional_nested_enum")));
|
||||
|
@ -80,6 +80,7 @@ import static com.google.protobuf.UnittestLite.optionalStringExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalStringPieceExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUint32ExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUint64ExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.optionalUnverifiedLazyMessageExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedBoolExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedDoubleExtensionLite;
|
||||
import static com.google.protobuf.UnittestLite.packedEnumExtensionLite;
|
||||
@ -197,6 +198,8 @@ public final class TestUtilLite {
|
||||
builder.setOptionalImportMessage(ImportMessageLite.newBuilder().setD(120).build());
|
||||
builder.setOptionalPublicImportMessage(PublicImportMessageLite.newBuilder().setE(126).build());
|
||||
builder.setOptionalLazyMessage(TestAllTypesLite.NestedMessage.newBuilder().setBb(127).build());
|
||||
builder.setOptionalUnverifiedLazyMessage(
|
||||
TestAllTypesLite.NestedMessage.newBuilder().setBb(128).build());
|
||||
|
||||
builder.setOptionalNestedEnum(TestAllTypesLite.NestedEnum.BAZ);
|
||||
builder.setOptionalForeignEnum(ForeignEnumLite.FOREIGN_LITE_BAZ);
|
||||
@ -355,6 +358,9 @@ public final class TestUtilLite {
|
||||
message.setExtension(
|
||||
optionalLazyMessageExtensionLite,
|
||||
TestAllTypesLite.NestedMessage.newBuilder().setBb(127).build());
|
||||
message.setExtension(
|
||||
optionalUnverifiedLazyMessageExtensionLite,
|
||||
TestAllTypesLite.NestedMessage.newBuilder().setBb(128).build());
|
||||
|
||||
message.setExtension(optionalNestedEnumExtensionLite, TestAllTypesLite.NestedEnum.BAZ);
|
||||
message.setExtension(optionalForeignEnumExtensionLite, ForeignEnumLite.FOREIGN_LITE_BAZ);
|
||||
|
@ -119,3 +119,8 @@ message ReservedAsMapFieldWithEnumValue {
|
||||
// null is not a 'reserved word' per se but as a literal needs similar care
|
||||
map<string, SampleEnum> null = 10;
|
||||
}
|
||||
|
||||
// https://github.com/protocolbuffers/protobuf/issues/9785
|
||||
message MapContainer {
|
||||
map<string,string> my_map = 1;
|
||||
}
|
||||
|
@ -118,3 +118,8 @@ message ReservedAsMapFieldWithEnumValue {
|
||||
// null is not a 'reserved word' per se but as a literal needs similar care
|
||||
map<string, SampleEnum> null = 10;
|
||||
}
|
||||
|
||||
// https://github.com/protocolbuffers/protobuf/issues/9785
|
||||
message MapContainer {
|
||||
map<string,string> my_map = 1;
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-kotlin-lite</artifactId>
|
||||
|
@ -93,6 +93,7 @@ class Proto2LiteTest {
|
||||
optionalImportMessage = ImportMessageLite.newBuilder().setD(120).build()
|
||||
optionalPublicImportMessage = PublicImportMessageLite.newBuilder().setE(126).build()
|
||||
optionalLazyMessage = nestedMessage { bb = 127 }
|
||||
optionalUnverifiedLazyMessage = nestedMessage { bb = 128 }
|
||||
optionalNestedEnum = NestedEnum.BAZ
|
||||
optionalForeignEnum = ForeignEnumLite.FOREIGN_LITE_BAZ
|
||||
optionalImportEnum = ImportEnumLite.IMPORT_LITE_BAZ
|
||||
@ -423,6 +424,8 @@ class Proto2LiteTest {
|
||||
PublicImportMessageLite.newBuilder().setE(126).build()
|
||||
this[UnittestLite.optionalLazyMessageExtensionLite] =
|
||||
TestAllTypesLiteKt.nestedMessage { bb = 127 }
|
||||
this[UnittestLite.optionalUnverifiedLazyMessageExtensionLite] =
|
||||
TestAllTypesLiteKt.nestedMessage { bb = 128 }
|
||||
this[UnittestLite.optionalNestedEnumExtensionLite] = NestedEnum.BAZ
|
||||
this[UnittestLite.optionalForeignEnumExtensionLite] = ForeignEnumLite.FOREIGN_LITE_BAZ
|
||||
this[UnittestLite.optionalImportEnumExtensionLite] = ImportEnumLite.IMPORT_LITE_BAZ
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-kotlin</artifactId>
|
||||
|
@ -98,6 +98,7 @@ class Proto2Test {
|
||||
optionalImportMessage = ImportMessage.newBuilder().setD(120).build()
|
||||
optionalPublicImportMessage = PublicImportMessage.newBuilder().setE(126).build()
|
||||
optionalLazyMessage = nestedMessage { bb = 127 }
|
||||
optionalUnverifiedLazyMessage = nestedMessage { bb = 128 }
|
||||
optionalNestedEnum = NestedEnum.BAZ
|
||||
optionalForeignEnum = ForeignEnum.FOREIGN_BAZ
|
||||
optionalImportEnum = ImportEnum.IMPORT_BAZ
|
||||
@ -415,6 +416,8 @@ class Proto2Test {
|
||||
PublicImportMessage.newBuilder().setE(126).build()
|
||||
this[UnittestProto.optionalLazyMessageExtension] =
|
||||
TestAllTypesKt.nestedMessage { bb = 127 }
|
||||
this[UnittestProto.optionalUnverifiedLazyMessageExtension] =
|
||||
TestAllTypesKt.nestedMessage { bb = 128 }
|
||||
this[UnittestProto.optionalNestedEnumExtension] = NestedEnum.BAZ
|
||||
this[UnittestProto.optionalForeignEnumExtension] = ForeignEnum.FOREIGN_BAZ
|
||||
this[UnittestProto.optionalImportEnumExtension] = ImportEnum.IMPORT_BAZ
|
||||
|
@ -29,7 +29,7 @@ protobuf Java Lite runtime. If you are using Maven, include the following:
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-javalite</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-javalite</artifactId>
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Protocol Buffers [Parent]</name>
|
||||
@ -87,12 +87,12 @@
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.1.1-android</version>
|
||||
<version>31.1-android</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava-testlib</artifactId>
|
||||
<version>30.1.1-android</version>
|
||||
<version>31.1-android</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-parent</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
|
@ -35,7 +35,7 @@ a pre-built binary from [https://github.com/protocolbuffers/protobuf/releases](h
|
||||
|
||||
If you want, you can compile `protoc` from source instead. To do this
|
||||
follow the instructions in [the top-level
|
||||
README](https://github.com/protocolbuffers/protobuf/blob/master/src/README.md).
|
||||
README](https://github.com/protocolbuffers/protobuf/blob/main/src/README.md).
|
||||
|
||||
Once you have `protoc` compiled, you can run the tests provided along with our project to examine whether it can run successfully. In order to do this, you should download the Protocol Buffer source code from the release page with the link above. Then extract the source code and navigate to the folder named `js` containing a `package.json` file and a series of test files. In this folder, you can run the commands below to run the tests automatically.
|
||||
|
||||
@ -129,7 +129,7 @@ The syntax of the `--js_out` flag is:
|
||||
Where `OPTIONS` are separated by commas. Options are either `opt=val` or
|
||||
just `opt` (for options that don't take a value). The available options
|
||||
are specified and documented in the `GeneratorOptions` struct in
|
||||
[src/google/protobuf/compiler/js/js_generator.h](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/js/js_generator.h#L53).
|
||||
[src/google/protobuf/compiler/js/js_generator.h](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/compiler/js/js_generator.h#L53).
|
||||
|
||||
Some examples:
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "google-protobuf",
|
||||
"version": "3.20.0-rc.1",
|
||||
"version": "3.20.1-rc.1",
|
||||
"description": "Protocol Buffers for JavaScript",
|
||||
"main": "google-protobuf.js",
|
||||
"files": [
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/protocolbuffers/protobuf/tree/master/js"
|
||||
"url": "https://github.com/protocolbuffers/protobuf/tree/main/js"
|
||||
},
|
||||
"author": "Google Protocol Buffers Team",
|
||||
"license": "BSD-3-Clause"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Adapted from https://github.com/googleapis/google-cloud-python/blob/master/.kokoro/publish-docs.sh
|
||||
# Adapted from https://github.com/googleapis/google-cloud-python/blob/main/.kokoro/publish-docs.sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Copied from https://github.com/googleapis/google-cloud-python/blob/master/.kokoro/trampoline.sh
|
||||
# Copied from https://github.com/googleapis/google-cloud-python/blob/main/.kokoro/trampoline.sh
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
|
@ -19,7 +19,7 @@ kokoro/linux/aarch64/dockcross_helpers/run_dockcross_manylinux2014_aarch64.sh ko
|
||||
|
||||
# the command that will be used to build and test java under an emulator
|
||||
# * IsValidUtf8Test and DecodeUtf8Test tests are being skipped because that take very long under an emulator.
|
||||
TEST_JAVA_COMMAND="mvn --batch-mode -DskipTests install && mvn --batch-mode -Dtest='**/*Test, !**/*IsValidUtf8Test, !**/*DecodeUtf8Test' -DfailIfNoTests=false surefire:test"
|
||||
TEST_JAVA_COMMAND="mvn --batch-mode -DskipTests install && mvn --batch-mode -Dtest='**/*Test, !**/*IsValidUtf8Test, !**/*DecodeUtf8Test' -DfailIfNoTests=false -Dsurefire.failIfNoSpecifiedTests=false surefire:test"
|
||||
|
||||
# use an actual aarch64 docker image (with a real aarch64 java and maven) to run build & test protobuf java under an emulator
|
||||
# * mount the protobuf root as /work to be able to access the crosscompiled files
|
||||
|
@ -234,8 +234,14 @@ fi
|
||||
objectivec/generate_well_known_types.sh --check-only -j "${NUM_MAKE_JOBS}"
|
||||
|
||||
header "Checking on the ObjC Runtime Code"
|
||||
objectivec/DevTools/pddm_tests.py
|
||||
if ! objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
|
||||
# Some of the kokoro machines don't have python3 yet, so fall back to python if need be.
|
||||
if hash python3 >/dev/null 2>&1 ; then
|
||||
LOCAL_PYTHON=python3
|
||||
else
|
||||
LOCAL_PYTHON=python
|
||||
fi
|
||||
"${LOCAL_PYTHON}" objectivec/DevTools/pddm_tests.py
|
||||
if ! "${LOCAL_PYTHON}" objectivec/DevTools/pddm.py --dry-run objectivec/*.[hm] objectivec/Tests/*.[hm] ; then
|
||||
echo ""
|
||||
echo "Update by running:"
|
||||
echo " objectivec/DevTools/pddm.py objectivec/*.[hm] objectivec/Tests/*.[hm]"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/python
|
||||
#! /usr/bin/env python3
|
||||
#
|
||||
# Protocol Buffers - Google's data interchange format
|
||||
# Copyright 2015 Google Inc. All rights reserved.
|
||||
@ -134,7 +134,10 @@ def _MacroArgRefRe(macro_arg_names):
|
||||
|
||||
class PDDMError(Exception):
|
||||
"""Error thrown by pddm."""
|
||||
pass
|
||||
|
||||
def __init__(self, message="Error"):
|
||||
self.message = message
|
||||
super().__init__(self.message)
|
||||
|
||||
|
||||
class MacroCollection(object):
|
||||
@ -318,7 +321,7 @@ class MacroCollection(object):
|
||||
# Nothing to do
|
||||
return macro.body
|
||||
assert len(arg_values) == len(macro.args)
|
||||
args = dict(zip(macro.args, arg_values))
|
||||
args = dict(list(zip(macro.args, arg_values)))
|
||||
|
||||
def _lookupArg(match):
|
||||
val = args[match.group('name')]
|
||||
@ -351,7 +354,7 @@ class MacroCollection(object):
|
||||
return macro_arg_ref_re.sub(_lookupArg, macro.body)
|
||||
|
||||
def _EvalMacrosRefs(self, text, macro_stack):
|
||||
macro_ref_re = _MacroRefRe(self._macros.keys())
|
||||
macro_ref_re = _MacroRefRe(list(self._macros.keys()))
|
||||
|
||||
def _resolveMacro(match):
|
||||
return self._Expand(match, macro_stack)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#! /usr/bin/python
|
||||
#! /usr/bin/env python3
|
||||
#
|
||||
# Protocol Buffers - Google's data interchange format
|
||||
# Copyright 2015 Google Inc. All rights reserved.
|
||||
@ -41,24 +41,24 @@ import pddm
|
||||
class TestParsingMacros(unittest.TestCase):
|
||||
|
||||
def testParseEmpty(self):
|
||||
f = io.StringIO(u'')
|
||||
f = io.StringIO('')
|
||||
result = pddm.MacroCollection(f)
|
||||
self.assertEqual(len(result._macros), 0)
|
||||
|
||||
def testParseOne(self):
|
||||
f = io.StringIO(u"""PDDM-DEFINE foo( )
|
||||
f = io.StringIO("""PDDM-DEFINE foo( )
|
||||
body""")
|
||||
result = pddm.MacroCollection(f)
|
||||
self.assertEqual(len(result._macros), 1)
|
||||
macro = result._macros.get('foo')
|
||||
self.assertIsNotNone(macro)
|
||||
self.assertEquals(macro.name, 'foo')
|
||||
self.assertEquals(macro.args, tuple())
|
||||
self.assertEquals(macro.body, 'body')
|
||||
self.assertEqual(macro.name, 'foo')
|
||||
self.assertEqual(macro.args, tuple())
|
||||
self.assertEqual(macro.body, 'body')
|
||||
|
||||
def testParseGeneral(self):
|
||||
# Tests multiple defines, spaces in all places, etc.
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE noArgs( )
|
||||
body1
|
||||
body2
|
||||
@ -74,21 +74,21 @@ body5""")
|
||||
self.assertEqual(len(result._macros), 3)
|
||||
macro = result._macros.get('noArgs')
|
||||
self.assertIsNotNone(macro)
|
||||
self.assertEquals(macro.name, 'noArgs')
|
||||
self.assertEquals(macro.args, tuple())
|
||||
self.assertEquals(macro.body, 'body1\nbody2\n')
|
||||
self.assertEqual(macro.name, 'noArgs')
|
||||
self.assertEqual(macro.args, tuple())
|
||||
self.assertEqual(macro.body, 'body1\nbody2\n')
|
||||
macro = result._macros.get('oneArg')
|
||||
self.assertIsNotNone(macro)
|
||||
self.assertEquals(macro.name, 'oneArg')
|
||||
self.assertEquals(macro.args, ('foo',))
|
||||
self.assertEquals(macro.body, 'body3')
|
||||
self.assertEqual(macro.name, 'oneArg')
|
||||
self.assertEqual(macro.args, ('foo',))
|
||||
self.assertEqual(macro.body, 'body3')
|
||||
macro = result._macros.get('twoArgs')
|
||||
self.assertIsNotNone(macro)
|
||||
self.assertEquals(macro.name, 'twoArgs')
|
||||
self.assertEquals(macro.args, ('bar_', 'baz'))
|
||||
self.assertEquals(macro.body, 'body4\nbody5')
|
||||
self.assertEqual(macro.name, 'twoArgs')
|
||||
self.assertEqual(macro.args, ('bar_', 'baz'))
|
||||
self.assertEqual(macro.body, 'body4\nbody5')
|
||||
# Add into existing collection
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE another(a,b,c)
|
||||
body1
|
||||
body2""")
|
||||
@ -96,23 +96,23 @@ body2""")
|
||||
self.assertEqual(len(result._macros), 4)
|
||||
macro = result._macros.get('another')
|
||||
self.assertIsNotNone(macro)
|
||||
self.assertEquals(macro.name, 'another')
|
||||
self.assertEquals(macro.args, ('a', 'b', 'c'))
|
||||
self.assertEquals(macro.body, 'body1\nbody2')
|
||||
self.assertEqual(macro.name, 'another')
|
||||
self.assertEqual(macro.args, ('a', 'b', 'c'))
|
||||
self.assertEqual(macro.body, 'body1\nbody2')
|
||||
|
||||
def testParseDirectiveIssues(self):
|
||||
test_list = [
|
||||
# Unknown directive
|
||||
(u'PDDM-DEFINE foo()\nbody\nPDDM-DEFINED foo\nbaz',
|
||||
('PDDM-DEFINE foo()\nbody\nPDDM-DEFINED foo\nbaz',
|
||||
'Hit a line with an unknown directive: '),
|
||||
# End without begin
|
||||
(u'PDDM-DEFINE foo()\nbody\nPDDM-DEFINE-END\nPDDM-DEFINE-END\n',
|
||||
('PDDM-DEFINE foo()\nbody\nPDDM-DEFINE-END\nPDDM-DEFINE-END\n',
|
||||
'Got DEFINE-END directive without an active macro: '),
|
||||
# Line not in macro block
|
||||
(u'PDDM-DEFINE foo()\nbody\nPDDM-DEFINE-END\nmumble\n',
|
||||
('PDDM-DEFINE foo()\nbody\nPDDM-DEFINE-END\nmumble\n',
|
||||
'Hit a line that wasn\'t a directive and no open macro definition: '),
|
||||
# Redefine macro
|
||||
(u'PDDM-DEFINE foo()\nbody\nPDDM-DEFINE foo(a)\nmumble\n',
|
||||
('PDDM-DEFINE foo()\nbody\nPDDM-DEFINE foo(a)\nmumble\n',
|
||||
'Attempt to redefine macro: '),
|
||||
]
|
||||
for idx, (input_str, expected_prefix) in enumerate(test_list, 1):
|
||||
@ -127,47 +127,47 @@ body2""")
|
||||
def testParseBeginIssues(self):
|
||||
test_list = [
|
||||
# 1. No name
|
||||
(u'PDDM-DEFINE\nmumble',
|
||||
('PDDM-DEFINE\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 2. No name (with spaces)
|
||||
(u'PDDM-DEFINE \nmumble',
|
||||
('PDDM-DEFINE \nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 3. No open paren
|
||||
(u'PDDM-DEFINE foo\nmumble',
|
||||
('PDDM-DEFINE foo\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 4. No close paren
|
||||
(u'PDDM-DEFINE foo(\nmumble',
|
||||
('PDDM-DEFINE foo(\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 5. No close paren (with args)
|
||||
(u'PDDM-DEFINE foo(a, b\nmumble',
|
||||
('PDDM-DEFINE foo(a, b\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 6. No name before args
|
||||
(u'PDDM-DEFINE (a, b)\nmumble',
|
||||
('PDDM-DEFINE (a, b)\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 7. No name before args
|
||||
(u'PDDM-DEFINE foo bar(a, b)\nmumble',
|
||||
('PDDM-DEFINE foo bar(a, b)\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
# 8. Empty arg name
|
||||
(u'PDDM-DEFINE foo(a, ,b)\nmumble',
|
||||
('PDDM-DEFINE foo(a, ,b)\nmumble',
|
||||
'Empty arg name in macro definition: '),
|
||||
(u'PDDM-DEFINE foo(a,,b)\nmumble',
|
||||
('PDDM-DEFINE foo(a,,b)\nmumble',
|
||||
'Empty arg name in macro definition: '),
|
||||
# 10. Duplicate name
|
||||
(u'PDDM-DEFINE foo(a,b,a,c)\nmumble',
|
||||
('PDDM-DEFINE foo(a,b,a,c)\nmumble',
|
||||
'Arg name "a" used more than once in macro definition: '),
|
||||
# 11. Invalid arg name
|
||||
(u'PDDM-DEFINE foo(a b,c)\nmumble',
|
||||
('PDDM-DEFINE foo(a b,c)\nmumble',
|
||||
'Invalid arg name "a b" in macro definition: '),
|
||||
(u'PDDM-DEFINE foo(a.b,c)\nmumble',
|
||||
('PDDM-DEFINE foo(a.b,c)\nmumble',
|
||||
'Invalid arg name "a.b" in macro definition: '),
|
||||
(u'PDDM-DEFINE foo(a-b,c)\nmumble',
|
||||
('PDDM-DEFINE foo(a-b,c)\nmumble',
|
||||
'Invalid arg name "a-b" in macro definition: '),
|
||||
(u'PDDM-DEFINE foo(a,b,c.)\nmumble',
|
||||
('PDDM-DEFINE foo(a,b,c.)\nmumble',
|
||||
'Invalid arg name "c." in macro definition: '),
|
||||
# 15. Extra stuff after the name
|
||||
(u'PDDM-DEFINE foo(a,c) foo\nmumble',
|
||||
('PDDM-DEFINE foo(a,c) foo\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
(u'PDDM-DEFINE foo(a,c) foo)\nmumble',
|
||||
('PDDM-DEFINE foo(a,c) foo)\nmumble',
|
||||
'Failed to parse macro definition: '),
|
||||
]
|
||||
for idx, (input_str, expected_prefix) in enumerate(test_list, 1):
|
||||
@ -183,7 +183,7 @@ body2""")
|
||||
class TestExpandingMacros(unittest.TestCase):
|
||||
|
||||
def testExpandBasics(self):
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE noArgs( )
|
||||
body1
|
||||
body2
|
||||
@ -203,21 +203,21 @@ PDDM-DEFINE-END
|
||||
""")
|
||||
mc = pddm.MacroCollection(f)
|
||||
test_list = [
|
||||
(u'noArgs()',
|
||||
('noArgs()',
|
||||
'body1\nbody2\n'),
|
||||
(u'oneArg(wee)',
|
||||
('oneArg(wee)',
|
||||
'body3 wee\n'),
|
||||
(u'twoArgs(having some, fun)',
|
||||
('twoArgs(having some, fun)',
|
||||
'body4 having some fun\nbody5'),
|
||||
# One arg, pass empty.
|
||||
(u'oneArg()',
|
||||
('oneArg()',
|
||||
'body3 \n'),
|
||||
# Two args, gets empty in each slot.
|
||||
(u'twoArgs(, empty)',
|
||||
('twoArgs(, empty)',
|
||||
'body4 empty\nbody5'),
|
||||
(u'twoArgs(empty, )',
|
||||
('twoArgs(empty, )',
|
||||
'body4 empty \nbody5'),
|
||||
(u'twoArgs(, )',
|
||||
('twoArgs(, )',
|
||||
'body4 \nbody5'),
|
||||
]
|
||||
for idx, (input_str, expected) in enumerate(test_list, 1):
|
||||
@ -227,7 +227,7 @@ PDDM-DEFINE-END
|
||||
(idx, result, expected))
|
||||
|
||||
def testExpandArgOptions(self):
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE bar(a)
|
||||
a-a$S-a$l-a$L-a$u-a$U
|
||||
PDDM-DEFINE-END
|
||||
@ -240,7 +240,7 @@ PDDM-DEFINE-END
|
||||
self.assertEqual(mc.Expand('bar()'), '-----')
|
||||
|
||||
def testExpandSimpleMacroErrors(self):
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE foo(a, b)
|
||||
<a-z>
|
||||
PDDM-DEFINE baz(a)
|
||||
@ -249,19 +249,19 @@ a - a$z
|
||||
mc = pddm.MacroCollection(f)
|
||||
test_list = [
|
||||
# 1. Unknown macro
|
||||
(u'bar()',
|
||||
('bar()',
|
||||
'No macro named "bar".'),
|
||||
(u'bar(a)',
|
||||
('bar(a)',
|
||||
'No macro named "bar".'),
|
||||
# 3. Arg mismatch
|
||||
(u'foo()',
|
||||
('foo()',
|
||||
'Expected 2 args, got: "foo()".'),
|
||||
(u'foo(a b)',
|
||||
('foo(a b)',
|
||||
'Expected 2 args, got: "foo(a b)".'),
|
||||
(u'foo(a,b,c)',
|
||||
('foo(a,b,c)',
|
||||
'Expected 2 args, got: "foo(a,b,c)".'),
|
||||
# 6. Unknown option in expansion
|
||||
(u'baz(mumble)',
|
||||
('baz(mumble)',
|
||||
'Unknown arg option "a$z" while expanding "baz(mumble)".'),
|
||||
]
|
||||
for idx, (input_str, expected_err) in enumerate(test_list, 1):
|
||||
@ -273,7 +273,7 @@ a - a$z
|
||||
'Entry %d failed: %r' % (idx, e))
|
||||
|
||||
def testExpandReferences(self):
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE StartIt()
|
||||
foo(abc, def)
|
||||
foo(ghi, jkl)
|
||||
@ -301,7 +301,7 @@ PDDM-DEFINE bar(n, t)
|
||||
self.assertEqual(mc.Expand('StartIt()'), expected)
|
||||
|
||||
def testCatchRecursion(self):
|
||||
f = io.StringIO(u"""
|
||||
f = io.StringIO("""
|
||||
PDDM-DEFINE foo(a, b)
|
||||
bar(1, a)
|
||||
bar(2, b)
|
||||
@ -322,29 +322,29 @@ class TestParsingSource(unittest.TestCase):
|
||||
def testBasicParse(self):
|
||||
test_list = [
|
||||
# 1. no directives
|
||||
(u'a\nb\nc',
|
||||
('a\nb\nc',
|
||||
(3,) ),
|
||||
# 2. One define
|
||||
(u'a\n//%PDDM-DEFINE foo()\n//%body\nc',
|
||||
('a\n//%PDDM-DEFINE foo()\n//%body\nc',
|
||||
(1, 2, 1) ),
|
||||
# 3. Two defines
|
||||
(u'a\n//%PDDM-DEFINE foo()\n//%body\n//%PDDM-DEFINE bar()\n//%body2\nc',
|
||||
('a\n//%PDDM-DEFINE foo()\n//%body\n//%PDDM-DEFINE bar()\n//%body2\nc',
|
||||
(1, 4, 1) ),
|
||||
# 4. Two defines with ends
|
||||
(u'a\n//%PDDM-DEFINE foo()\n//%body\n//%PDDM-DEFINE-END\n'
|
||||
u'//%PDDM-DEFINE bar()\n//%body2\n//%PDDM-DEFINE-END\nc',
|
||||
('a\n//%PDDM-DEFINE foo()\n//%body\n//%PDDM-DEFINE-END\n'
|
||||
'//%PDDM-DEFINE bar()\n//%body2\n//%PDDM-DEFINE-END\nc',
|
||||
(1, 6, 1) ),
|
||||
# 5. One expand, one define (that runs to end of file)
|
||||
(u'a\n//%PDDM-EXPAND foo()\nbody\n//%PDDM-EXPAND-END\n'
|
||||
u'//%PDDM-DEFINE bar()\n//%body2\n',
|
||||
('a\n//%PDDM-EXPAND foo()\nbody\n//%PDDM-EXPAND-END\n'
|
||||
'//%PDDM-DEFINE bar()\n//%body2\n',
|
||||
(1, 1, 2) ),
|
||||
# 6. One define ended with an expand.
|
||||
(u'a\nb\n//%PDDM-DEFINE bar()\n//%body2\n'
|
||||
u'//%PDDM-EXPAND bar()\nbody2\n//%PDDM-EXPAND-END\n',
|
||||
('a\nb\n//%PDDM-DEFINE bar()\n//%body2\n'
|
||||
'//%PDDM-EXPAND bar()\nbody2\n//%PDDM-EXPAND-END\n',
|
||||
(2, 2, 1) ),
|
||||
# 7. Two expands (one end), one define.
|
||||
(u'a\n//%PDDM-EXPAND foo(1)\nbody\n//%PDDM-EXPAND foo(2)\nbody2\n//%PDDM-EXPAND-END\n'
|
||||
u'//%PDDM-DEFINE foo()\n//%body2\n',
|
||||
('a\n//%PDDM-EXPAND foo(1)\nbody\n//%PDDM-EXPAND foo(2)\nbody2\n//%PDDM-EXPAND-END\n'
|
||||
'//%PDDM-DEFINE foo()\n//%body2\n',
|
||||
(1, 2, 2) ),
|
||||
]
|
||||
for idx, (input_str, line_counts) in enumerate(test_list, 1):
|
||||
@ -362,24 +362,24 @@ class TestParsingSource(unittest.TestCase):
|
||||
def testErrors(self):
|
||||
test_list = [
|
||||
# 1. Directive within expansion
|
||||
(u'//%PDDM-EXPAND a()\n//%PDDM-BOGUS',
|
||||
('//%PDDM-EXPAND a()\n//%PDDM-BOGUS',
|
||||
'Ran into directive ("//%PDDM-BOGUS", line 2) while in "//%PDDM-EXPAND a()".'),
|
||||
(u'//%PDDM-EXPAND a()\n//%PDDM-DEFINE a()\n//%body\n',
|
||||
('//%PDDM-EXPAND a()\n//%PDDM-DEFINE a()\n//%body\n',
|
||||
'Ran into directive ("//%PDDM-DEFINE", line 2) while in "//%PDDM-EXPAND a()".'),
|
||||
# 3. Expansion ran off end of file
|
||||
(u'//%PDDM-EXPAND a()\na\nb\n',
|
||||
('//%PDDM-EXPAND a()\na\nb\n',
|
||||
'Hit the end of the file while in "//%PDDM-EXPAND a()".'),
|
||||
# 4. Directive within define
|
||||
(u'//%PDDM-DEFINE a()\n//%body\n//%PDDM-BOGUS',
|
||||
('//%PDDM-DEFINE a()\n//%body\n//%PDDM-BOGUS',
|
||||
'Ran into directive ("//%PDDM-BOGUS", line 3) while in "//%PDDM-DEFINE a()".'),
|
||||
(u'//%PDDM-DEFINE a()\n//%body\n//%PDDM-EXPAND-END a()',
|
||||
('//%PDDM-DEFINE a()\n//%body\n//%PDDM-EXPAND-END a()',
|
||||
'Ran into directive ("//%PDDM-EXPAND-END", line 3) while in "//%PDDM-DEFINE a()".'),
|
||||
# 6. Directives that shouldn't start sections
|
||||
(u'a\n//%PDDM-DEFINE-END a()\n//a\n',
|
||||
('a\n//%PDDM-DEFINE-END a()\n//a\n',
|
||||
'Unexpected line 2: "//%PDDM-DEFINE-END a()".'),
|
||||
(u'a\n//%PDDM-EXPAND-END a()\n//a\n',
|
||||
('a\n//%PDDM-EXPAND-END a()\n//a\n',
|
||||
'Unexpected line 2: "//%PDDM-EXPAND-END a()".'),
|
||||
(u'//%PDDM-BOGUS\n//a\n',
|
||||
('//%PDDM-BOGUS\n//a\n',
|
||||
'Unexpected line 1: "//%PDDM-BOGUS".'),
|
||||
]
|
||||
for idx, (input_str, expected_err) in enumerate(test_list, 1):
|
||||
@ -395,7 +395,7 @@ class TestProcessingSource(unittest.TestCase):
|
||||
|
||||
def testBasics(self):
|
||||
self.maxDiff = None
|
||||
input_str = u"""
|
||||
input_str = """
|
||||
//%PDDM-IMPORT-DEFINES ImportFile
|
||||
foo
|
||||
//%PDDM-EXPAND mumble(abc)
|
||||
@ -408,12 +408,12 @@ baz
|
||||
//%PDDM-DEFINE mumble(a_)
|
||||
//%a_: getName(a_)
|
||||
"""
|
||||
input_str2 = u"""
|
||||
input_str2 = """
|
||||
//%PDDM-DEFINE getName(x_)
|
||||
//%do##x_$u##(int x_);
|
||||
|
||||
"""
|
||||
expected = u"""
|
||||
expected = """
|
||||
//%PDDM-IMPORT-DEFINES ImportFile
|
||||
foo
|
||||
//%PDDM-EXPAND mumble(abc)
|
||||
@ -441,7 +441,7 @@ baz
|
||||
//%PDDM-DEFINE mumble(a_)
|
||||
//%a_: getName(a_)
|
||||
"""
|
||||
expected_stripped = u"""
|
||||
expected_stripped = """
|
||||
//%PDDM-IMPORT-DEFINES ImportFile
|
||||
foo
|
||||
//%PDDM-EXPAND mumble(abc)
|
||||
@ -478,7 +478,7 @@ baz
|
||||
self.assertEqual(sf2.processed_content, expected_stripped)
|
||||
|
||||
def testProcessFileWithMacroParseError(self):
|
||||
input_str = u"""
|
||||
input_str = """
|
||||
foo
|
||||
//%PDDM-DEFINE mumble(a_)
|
||||
//%body
|
||||
@ -498,7 +498,7 @@ foo
|
||||
' Line 3: //%PDDM-DEFINE mumble(a_)')
|
||||
|
||||
def testProcessFileWithExpandError(self):
|
||||
input_str = u"""
|
||||
input_str = """
|
||||
foo
|
||||
//%PDDM-DEFINE mumble(a_)
|
||||
//%body
|
||||
|
@ -46,9 +46,9 @@ NSString *const GPBCodedInputStreamErrorDomain =
|
||||
GPBNSStringifySymbol(GPBCodedInputStreamErrorDomain);
|
||||
|
||||
// Matching:
|
||||
// https://github.com/protocolbuffers/protobuf/blob/master/java/core/src/main/java/com/google/protobuf/CodedInputStream.java#L62
|
||||
// https://github.com/protocolbuffers/protobuf/blob/main/java/core/src/main/java/com/google/protobuf/CodedInputStream.java#L62
|
||||
// private static final int DEFAULT_RECURSION_LIMIT = 100;
|
||||
// https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/io/coded_stream.cc#L86
|
||||
// https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/io/coded_stream.cc#L86
|
||||
// int CodedInputStream::default_recursion_limit_ = 100;
|
||||
static const NSUInteger kDefaultRecursionLimit = 100;
|
||||
|
||||
|
@ -6,5 +6,6 @@ if test "$PHP_PROTOBUF" != "no"; then
|
||||
protobuf,
|
||||
arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c third_party/utf8_range/naive.c third_party/utf8_range/range2-neon.c third_party/utf8_range/range2-sse.c,
|
||||
$ext_shared, , -std=gnu99)
|
||||
PHP_ADD_BUILD_DIR($ext_builddir/third_party/utf8_range)
|
||||
|
||||
fi
|
||||
|
@ -82,12 +82,12 @@ const char *const kReservedNames[] = {
|
||||
"global", "goto", "insteadof", "interface", "isset",
|
||||
"list", "match", "namespace", "new", "object",
|
||||
"or", "parent", "print", "private", "protected",
|
||||
"public", "require", "require_once", "return", "self",
|
||||
"static", "switch", "throw", "trait", "try",
|
||||
"unset", "use", "var", "while", "xor",
|
||||
"yield", "int", "float", "bool", "string",
|
||||
"true", "false", "null", "void", "iterable",
|
||||
NULL};
|
||||
"public", "readonly", "require", "require_once", "return",
|
||||
"self", "static", "switch", "throw", "trait",
|
||||
"try", "unset", "use", "var", "while",
|
||||
"xor", "yield", "int", "float", "bool",
|
||||
"string", "true", "false", "null", "void",
|
||||
"iterable", NULL};
|
||||
|
||||
bool is_reserved_name(const char* name) {
|
||||
int i;
|
||||
|
@ -10,15 +10,15 @@
|
||||
<email>protobuf-opensource@google.com</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2022-03-25</date>
|
||||
<time>19:17:44</time>
|
||||
<date>2022-04-05</date>
|
||||
<time>17:06:47</time>
|
||||
<version>
|
||||
<release>3.20.0</release>
|
||||
<api>3.20.0</api>
|
||||
<release>3.20.1RC1</release>
|
||||
<api>3.20.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>stable</release>
|
||||
<api>stable</api>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<license uri="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</license>
|
||||
<notes>
|
||||
@ -1253,5 +1253,20 @@ G A release.
|
||||
<notes>
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<version>
|
||||
<release>3.20.1RC1</release>
|
||||
<api>3.20.1</api>
|
||||
</version>
|
||||
<stability>
|
||||
<release>beta</release>
|
||||
<api>beta</api>
|
||||
</stability>
|
||||
<date>2022-04-05</date>
|
||||
<time>17:06:47</time>
|
||||
<license uri="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</license>
|
||||
<notes>
|
||||
</notes>
|
||||
</release>
|
||||
</changelog>
|
||||
</package>
|
||||
|
@ -127,7 +127,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setter, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, value)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define PHP_PROTOBUF_VERSION "3.20.0"
|
||||
#define PHP_PROTOBUF_VERSION "3.20.1RC1"
|
||||
|
||||
// ptr -> PHP object cache. This is a weak map that caches lazily-created
|
||||
// wrapper objects around upb types:
|
||||
|
@ -285,11 +285,12 @@ class GPBUtil
|
||||
"include"=>0, "include_once"=>0, "instanceof"=>0, "insteadof"=>0,
|
||||
"interface"=>0, "isset"=>0, "list"=>0, "match"=>0, "namespace"=>0,
|
||||
"new"=>0, "or"=>0, "parent"=>0, "print"=>0, "private"=>0,
|
||||
"protected"=>0,"public"=>0, "require"=>0, "require_once"=>0,
|
||||
"return"=>0, "self"=>0, "static"=>0, "switch"=>0, "throw"=>0,
|
||||
"trait"=>0, "try"=>0,"unset"=>0, "use"=>0, "var"=>0, "while"=>0,
|
||||
"xor"=>0, "yield"=>0, "int"=>0, "float"=>0, "bool"=>0, "string"=>0,
|
||||
"true"=>0, "false"=>0, "null"=>0, "void"=>0, "iterable"=>0
|
||||
"protected"=>0,"public"=>0, "readonly" => 0,"require"=>0,
|
||||
"require_once"=>0,"return"=>0, "self"=>0, "static"=>0, "switch"=>0,
|
||||
"throw"=>0,"trait"=>0, "try"=>0,"unset"=>0, "use"=>0, "var"=>0,
|
||||
"while"=>0,"xor"=>0, "yield"=>0, "int"=>0, "float"=>0, "bool"=>0,
|
||||
"string"=>0,"true"=>0, "false"=>0, "null"=>0, "void"=>0,
|
||||
"iterable"=>0
|
||||
);
|
||||
|
||||
if (array_key_exists(strtolower($classname), $reserved_words)) {
|
||||
|
@ -330,6 +330,18 @@ class GeneratedClassTest extends TestBase
|
||||
$this->legacyEnum(new TestLegacyMessage\NestedEnum);
|
||||
}
|
||||
|
||||
public function testLegacyReadOnlyMessage()
|
||||
{
|
||||
$this->assertTrue(class_exists('\Upper\READONLY'));
|
||||
$this->assertTrue(class_exists('\Lower\readonly'));
|
||||
}
|
||||
|
||||
public function testLegacyReadOnlyEnum()
|
||||
{
|
||||
$this->assertTrue(class_exists('\Upper_enum\READONLY'));
|
||||
$this->assertTrue(class_exists('\Lower_enum\readonly'));
|
||||
}
|
||||
|
||||
private function legacyEnum(TestLegacyMessage_NestedEnum $enum)
|
||||
{
|
||||
// If we made it here without a PHP Fatal error, the typehint worked
|
||||
@ -939,6 +951,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = new \Lower\PBprivate();
|
||||
$m = new \Lower\PBprotected();
|
||||
$m = new \Lower\PBpublic();
|
||||
$m = new \Lower\PBreadonly();
|
||||
$m = new \Lower\PBrequire();
|
||||
$m = new \Lower\PBrequire_once();
|
||||
$m = new \Lower\PBreturn();
|
||||
@ -1019,6 +1032,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = new \Upper\PBPRIVATE();
|
||||
$m = new \Upper\PBPROTECTED();
|
||||
$m = new \Upper\PBPUBLIC();
|
||||
$m = new \Upper\PBREADONLY();
|
||||
$m = new \Upper\PBREQUIRE();
|
||||
$m = new \Upper\PBREQUIRE_ONCE();
|
||||
$m = new \Upper\PBRETURN();
|
||||
@ -1100,6 +1114,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = new \Lower_enum\PBprotected();
|
||||
$m = new \Lower_enum\PBpublic();
|
||||
$m = new \Lower_enum\PBrequire();
|
||||
$m = new \Lower_enum\PBreadonly();
|
||||
$m = new \Lower_enum\PBrequire_once();
|
||||
$m = new \Lower_enum\PBreturn();
|
||||
$m = new \Lower_enum\PBself();
|
||||
@ -1179,6 +1194,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = new \Upper_enum\PBPRIVATE();
|
||||
$m = new \Upper_enum\PBPROTECTED();
|
||||
$m = new \Upper_enum\PBPUBLIC();
|
||||
$m = new \Upper_enum\PBREADONLY();
|
||||
$m = new \Upper_enum\PBREQUIRE();
|
||||
$m = new \Upper_enum\PBREQUIRE_ONCE();
|
||||
$m = new \Upper_enum\PBRETURN();
|
||||
@ -1283,6 +1299,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = \Lower_enum_value\NotAllowed::iterable;
|
||||
$m = \Lower_enum_value\NotAllowed::parent;
|
||||
$m = \Lower_enum_value\NotAllowed::self;
|
||||
$m = \Lower_enum_value\NotAllowed::readonly;
|
||||
|
||||
$m = \Upper_enum_value\NotAllowed::PBABSTRACT;
|
||||
$m = \Upper_enum_value\NotAllowed::PBAND;
|
||||
@ -1363,6 +1380,7 @@ class GeneratedClassTest extends TestBase
|
||||
$m = \Upper_enum_value\NotAllowed::ITERABLE;
|
||||
$m = \Upper_enum_value\NotAllowed::PARENT;
|
||||
$m = \Upper_enum_value\NotAllowed::SELF;
|
||||
$m = \Upper_enum_value\NotAllowed::READONLY;
|
||||
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
|
@ -57,6 +57,7 @@ enum print { ZERO51 = 0; }
|
||||
enum private { ZERO52 = 0; }
|
||||
enum protected { ZERO53 = 0; }
|
||||
enum public { ZERO54 = 0; }
|
||||
enum readonly { ZERO80 = 0; }
|
||||
enum require { ZERO55 = 0; }
|
||||
enum require_once { ZERO56 = 0; }
|
||||
enum return { ZERO57 = 0; }
|
||||
|
@ -57,6 +57,7 @@ enum PRINT { ZERO51 = 0; }
|
||||
enum PRIVATE { ZERO52 = 0; }
|
||||
enum PROTECTED { ZERO53 = 0; }
|
||||
enum PUBLIC { ZERO54 = 0; }
|
||||
enum READONLY { ZERO80 = 0; }
|
||||
enum REQUIRE { ZERO55 = 0; }
|
||||
enum REQUIRE_ONCE { ZERO56 = 0; }
|
||||
enum RETURN { ZERO57 = 0; }
|
||||
|
@ -58,6 +58,7 @@ enum NotAllowed {
|
||||
private = 51;
|
||||
protected = 52;
|
||||
public = 53;
|
||||
readonly = 79;
|
||||
require = 54;
|
||||
require_once = 55;
|
||||
return = 56;
|
||||
|
@ -58,6 +58,7 @@ enum NotAllowed {
|
||||
PRIVATE = 51;
|
||||
PROTECTED = 52;
|
||||
PUBLIC = 53;
|
||||
READONLY = 79;
|
||||
REQUIRE = 54;
|
||||
REQUIRE_ONCE = 55;
|
||||
RETURN = 56;
|
||||
|
@ -57,6 +57,7 @@ message print {}
|
||||
message private {}
|
||||
message protected {}
|
||||
message public {}
|
||||
message readonly {}
|
||||
message require {}
|
||||
message require_once {}
|
||||
message return {}
|
||||
|
@ -57,6 +57,7 @@ message PRINT {}
|
||||
message PRIVATE {}
|
||||
message PROTECTED {}
|
||||
message PUBLIC {}
|
||||
message READONLY {}
|
||||
message REQUIRE {}
|
||||
message REQUIRE_ONCE {}
|
||||
message RETURN {}
|
||||
|
17
protobuf.bzl
17
protobuf.bzl
@ -79,17 +79,20 @@ def _proto_gen_impl(ctx):
|
||||
deps = depset(direct=ctx.files.srcs)
|
||||
source_dir = _SourceDir(ctx)
|
||||
gen_dir = _GenDir(ctx).rstrip("/")
|
||||
import_flags = []
|
||||
|
||||
if source_dir:
|
||||
has_sources = any([src.is_source for src in srcs])
|
||||
has_generated = any([not src.is_source for src in srcs])
|
||||
import_flags = []
|
||||
if has_sources:
|
||||
import_flags += ["-I" + source_dir]
|
||||
if has_generated:
|
||||
import_flags += ["-I" + gen_dir]
|
||||
import_flags = depset(direct=import_flags)
|
||||
else:
|
||||
import_flags = depset(direct=["-I."])
|
||||
import_flags += ["-I."]
|
||||
|
||||
has_generated = any([not src.is_source for src in srcs])
|
||||
if has_generated:
|
||||
import_flags += ["-I" + gen_dir]
|
||||
|
||||
import_flags = depset(direct=import_flags)
|
||||
|
||||
for dep in ctx.attr.deps:
|
||||
if type(dep.proto.import_flags) == "list":
|
||||
@ -163,7 +166,7 @@ def _proto_gen_impl(ctx):
|
||||
for out in outs:
|
||||
orig_command = " ".join(
|
||||
["$(realpath %s)" % ctx.executable.protoc.path] + args +
|
||||
import_flags_real + ["-I.", src.basename],
|
||||
import_flags_real + [src.basename],
|
||||
)
|
||||
command = ";".join([
|
||||
'CMD="%s"' % orig_command,
|
||||
|
@ -27,6 +27,15 @@ def protobuf_deps():
|
||||
],
|
||||
)
|
||||
|
||||
if not native.existing_rule("com_google_absl"):
|
||||
# Abseil LTS from November 2021
|
||||
http_archive(
|
||||
name = "com_google_absl",
|
||||
sha256 = "b4e20d9e752a75c10636675691b1e9c2698e0764cb404987d0ffa77223041c19",
|
||||
urls = ["https://github.com/abseil/abseil-cpp/archive/215105818dfde3174fe799600bb0f3cae233d0bf.zip"],
|
||||
strip_prefix = "abseil-cpp-215105818dfde3174fe799600bb0f3cae233d0bf",
|
||||
)
|
||||
|
||||
if not native.existing_rule("zlib"):
|
||||
http_archive(
|
||||
name = "zlib",
|
||||
|
@ -1 +1 @@
|
||||
PROTOBUF_VERSION = '3.20.0'
|
||||
PROTOBUF_VERSION = '3.20.1-rc-1'
|
||||
|
@ -8,7 +8,7 @@
|
||||
</parent>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protoc</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Protobuf Compiler</name>
|
||||
<description>
|
||||
|
@ -111,7 +111,7 @@ AUTOMODULE_TEMPLATE = """.. DO NOT EDIT, generated by generate_docs.py.
|
||||
.. warning::
|
||||
|
||||
You are reading the documentation for the `latest committed changes
|
||||
<https://github.com/protocolbuffers/protobuf/tree/master/python>`_ of
|
||||
<https://github.com/protocolbuffers/protobuf/tree/main/python>`_ of
|
||||
the `Protocol Buffers package for Python
|
||||
<https://developers.google.com/protocol-buffers/docs/pythontutorial>`_.
|
||||
Some features may not yet be released. Read the documentation for the
|
||||
|
@ -30,4 +30,4 @@
|
||||
|
||||
# Copyright 2007 Google Inc. All Rights Reserved.
|
||||
|
||||
__version__ = '3.20.0rc1'
|
||||
__version__ = '3.20.1rc1'
|
||||
|
@ -40,13 +40,14 @@ import warnings
|
||||
from google.protobuf.internal import api_implementation
|
||||
|
||||
_USE_C_DESCRIPTORS = False
|
||||
if api_implementation.Type() == 'cpp':
|
||||
if api_implementation.Type() != 'python':
|
||||
# Used by MakeDescriptor in cpp mode
|
||||
import binascii
|
||||
import os
|
||||
if api_implementation._Version() == 3:
|
||||
from google3.third_party.upb.python import _message
|
||||
else:
|
||||
# pylint: disable=protected-access
|
||||
_message = api_implementation._c_module
|
||||
# TODO(jieluo): Remove this import after fix api_implementation
|
||||
if _message is None:
|
||||
from google.protobuf.pyext import _message
|
||||
_USE_C_DESCRIPTORS = True
|
||||
|
||||
@ -601,13 +602,13 @@ class FieldDescriptor(DescriptorBase):
|
||||
self.is_extension = is_extension
|
||||
self.extension_scope = extension_scope
|
||||
self.containing_oneof = containing_oneof
|
||||
if api_implementation.Type() == 'cpp':
|
||||
if api_implementation.Type() == 'python':
|
||||
self._cdescriptor = None
|
||||
else:
|
||||
if is_extension:
|
||||
self._cdescriptor = _message.default_pool.FindExtensionByName(full_name)
|
||||
else:
|
||||
self._cdescriptor = _message.default_pool.FindFieldByName(full_name)
|
||||
else:
|
||||
self._cdescriptor = None
|
||||
|
||||
@property
|
||||
def camelcase_name(self):
|
||||
@ -1138,7 +1139,7 @@ def MakeDescriptor(desc_proto, package='', build_file_if_cpp=True,
|
||||
Returns:
|
||||
A Descriptor for protobuf messages.
|
||||
"""
|
||||
if api_implementation.Type() == 'cpp' and build_file_if_cpp:
|
||||
if api_implementation.Type() != 'python' and build_file_if_cpp:
|
||||
# The C++ implementation requires all descriptors to be backed by the same
|
||||
# definition in the C++ descriptor pool. To do this, we build a
|
||||
# FileDescriptorProto with the same definition as this descriptor and build
|
||||
|
@ -50,24 +50,61 @@ if _api_version == 1:
|
||||
|
||||
|
||||
|
||||
_default_implementation_type = ('cpp' if _api_version > 0 else 'python')
|
||||
|
||||
def _ApiVersionToImplementationType(api_version):
|
||||
if api_version == 3:
|
||||
return 'upb'
|
||||
if api_version == 2:
|
||||
return 'cpp'
|
||||
return 'python'
|
||||
|
||||
# TODO(jieluo): Remove _api_version and only keep implementation_type
|
||||
# http://b/228103078
|
||||
_default_implementation_type = _ApiVersionToImplementationType(_api_version)
|
||||
|
||||
|
||||
# This environment variable can be used to switch to a certain implementation
|
||||
# of the Python API, overriding the compile-time constants in the
|
||||
# _api_implementation module. Right now only 'python' and 'cpp' are valid
|
||||
# values. Any other value will be ignored.
|
||||
# _api_implementation module. Right now only 'python', 'cpp' and 'upb' are
|
||||
# valid values. Any other value will raise error.
|
||||
_implementation_type = os.getenv('PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION',
|
||||
_default_implementation_type)
|
||||
|
||||
if _implementation_type != 'python':
|
||||
_implementation_type = 'cpp'
|
||||
if _implementation_type not in ('python', 'cpp', 'upb'):
|
||||
raise ValueError('PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION {0} is not '
|
||||
'supported. Please set to \'python\', \'cpp\' or '
|
||||
'\'upb\'.'.format(_implementation_type))
|
||||
|
||||
if 'PyPy' in sys.version and _implementation_type == 'cpp':
|
||||
warnings.warn('PyPy does not work yet with cpp protocol buffers. '
|
||||
'Falling back to the python implementation.')
|
||||
_implementation_type = 'python'
|
||||
|
||||
_c_module = None
|
||||
|
||||
if _implementation_type == 'cpp':
|
||||
try:
|
||||
# pylint: disable=g-import-not-at-top
|
||||
from google.protobuf.pyext import _message
|
||||
_c_module = _message
|
||||
del _message
|
||||
except ImportError:
|
||||
# TODO(jieluo): fail back to python
|
||||
warnings.warn(
|
||||
'Selected implementation cpp is not available.')
|
||||
pass
|
||||
|
||||
if _implementation_type == 'upb':
|
||||
try:
|
||||
# pylint: disable=g-import-not-at-top
|
||||
from google.protobuf.pyext import _upb_message as _message
|
||||
_c_module = _message
|
||||
del _message
|
||||
except ImportError:
|
||||
warnings.warn('Selected implementation upb is not available. '
|
||||
'Falling back to the python implementation.')
|
||||
_implementation_type = 'python'
|
||||
pass
|
||||
|
||||
# Detect if serialization should be deterministic by default
|
||||
try:
|
||||
@ -104,12 +141,8 @@ def _SetType(implementation_type):
|
||||
_implementation_type = implementation_type
|
||||
|
||||
|
||||
def _Version():
|
||||
"""Never use! For protobuf internal use only."""
|
||||
return _api_version
|
||||
|
||||
|
||||
# See comment on 'Type' above.
|
||||
# TODO(jieluo): Remove the API, it returns a constant. b/228102101
|
||||
def Version():
|
||||
return 2
|
||||
|
||||
|
@ -144,7 +144,7 @@ class DescriptorTest(unittest.TestCase):
|
||||
self.assertEqual(self.my_service, self.my_method.containing_service)
|
||||
|
||||
@unittest.skipIf(
|
||||
api_implementation.Type() != 'cpp',
|
||||
api_implementation.Type() == 'python',
|
||||
'GetDebugString is only available with the cpp implementation',
|
||||
)
|
||||
def testGetDebugString(self):
|
||||
@ -457,7 +457,7 @@ class DescriptorTest(unittest.TestCase):
|
||||
self.assertEqual(unittest_pb2.DESCRIPTOR.pool, descriptor_pool.Default())
|
||||
|
||||
@unittest.skipIf(
|
||||
api_implementation.Type() != 'cpp' or api_implementation.Version() != 2,
|
||||
api_implementation.Type() == 'python',
|
||||
'Immutability of descriptors is only enforced in v2 implementation')
|
||||
def testImmutableCppDescriptor(self):
|
||||
file_descriptor = unittest_pb2.DESCRIPTOR
|
||||
|
@ -130,7 +130,7 @@ class MessageTest(unittest.TestCase):
|
||||
# b/27494216
|
||||
end_tag = encoder.TagBytes(1, 4)
|
||||
if (api_implementation.Type() == 'python' or
|
||||
api_implementation._Version() == 3):
|
||||
api_implementation.Type() == 'upb'):
|
||||
with self.assertRaises(message.DecodeError) as context:
|
||||
msg.FromString(end_tag)
|
||||
if api_implementation.Type() == 'python':
|
||||
|
@ -2020,7 +2020,7 @@ class Proto2ReflectionTest(unittest.TestCase):
|
||||
self.assertRaises(TypeError, proto.IsInitialized, 1, 2, 3)
|
||||
|
||||
@unittest.skipIf(
|
||||
api_implementation.Type() != 'cpp' or api_implementation.Version() != 2,
|
||||
api_implementation.Type() == 'python',
|
||||
'Errors are only available from the most recent C++ implementation.')
|
||||
def testFileDescriptorErrors(self):
|
||||
file_name = 'test_file_descriptor_errors.proto'
|
||||
@ -3225,7 +3225,7 @@ class OptionsTest(unittest.TestCase):
|
||||
class ClassAPITest(unittest.TestCase):
|
||||
|
||||
@unittest.skipIf(
|
||||
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
|
||||
api_implementation.Type() != 'python',
|
||||
'C++ implementation requires a call to MakeDescriptor()')
|
||||
@testing_refleaks.SkipReferenceLeakChecker('MakeClass is not repeatable')
|
||||
def testMakeClassWithNestedDescriptor(self):
|
||||
|
@ -218,6 +218,7 @@ def SetAllNonLazyFields(message):
|
||||
def SetAllFields(message):
|
||||
SetAllNonLazyFields(message)
|
||||
message.optional_lazy_message.bb = 127
|
||||
message.optional_unverified_lazy_message.bb = 128
|
||||
|
||||
|
||||
def SetAllExtensions(message):
|
||||
@ -257,6 +258,7 @@ def SetAllExtensions(message):
|
||||
extensions[pb2.optional_import_message_extension].d = 120
|
||||
extensions[pb2.optional_public_import_message_extension].e = 126
|
||||
extensions[pb2.optional_lazy_message_extension].bb = 127
|
||||
extensions[pb2.optional_unverified_lazy_message_extension].bb = 128
|
||||
|
||||
extensions[pb2.optional_nested_enum_extension] = pb2.TestAllTypes.BAZ
|
||||
extensions[pb2.optional_nested_enum_extension] = pb2.TestAllTypes.BAZ
|
||||
@ -465,6 +467,7 @@ def ExpectAllFieldsSet(test_case, message):
|
||||
test_case.assertEqual(120, message.optional_import_message.d)
|
||||
test_case.assertEqual(126, message.optional_public_import_message.e)
|
||||
test_case.assertEqual(127, message.optional_lazy_message.bb)
|
||||
test_case.assertEqual(128, message.optional_unverified_lazy_message.bb)
|
||||
|
||||
test_case.assertEqual(unittest_pb2.TestAllTypes.BAZ,
|
||||
message.optional_nested_enum)
|
||||
|
@ -78,12 +78,23 @@ class ReferenceLeakCheckerMixin(object):
|
||||
|
||||
oldrefcount = 0
|
||||
local_result = LocalTestResult(result)
|
||||
num_flakes = 0
|
||||
|
||||
refcount_deltas = []
|
||||
for _ in range(self.NB_RUNS):
|
||||
while len(refcount_deltas) < self.NB_RUNS:
|
||||
oldrefcount = self._getRefcounts()
|
||||
super(ReferenceLeakCheckerMixin, self).run(result=local_result)
|
||||
newrefcount = self._getRefcounts()
|
||||
# If the GC was able to collect some objects after the call to run() that
|
||||
# it could not collect before the call, then the counts won't match.
|
||||
if newrefcount < oldrefcount and num_flakes < 2:
|
||||
# This result is (probably) a flake -- garbage collectors aren't very
|
||||
# predictable, but a lower ending refcount is the opposite of the
|
||||
# failure we are testing for. If the result is repeatable, then we will
|
||||
# eventually report it, but not after trying to eliminate it.
|
||||
num_flakes += 1
|
||||
continue
|
||||
num_flakes = 0
|
||||
refcount_deltas.append(newrefcount - oldrefcount)
|
||||
print(refcount_deltas, self)
|
||||
|
||||
|
@ -584,7 +584,7 @@ class TextFormatMessageToStringTests(TextFormatBase):
|
||||
self.assertEqual(message_proto, parsed_proto)
|
||||
|
||||
@unittest.skipIf(
|
||||
api_implementation._Version() == 3,
|
||||
api_implementation.Type() == 'upb',
|
||||
"upb API doesn't support old UnknownField API. The TextFormat library "
|
||||
"needs to convert to the new API.")
|
||||
def testPrintUnknownFieldsEmbeddedMessageInBytes(self, message_module):
|
||||
|
@ -268,7 +268,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase):
|
||||
self.InternalCheckUnknownField('optionalgroup',
|
||||
self.all_fields.optionalgroup)
|
||||
|
||||
self.assertEqual(97, len(unknown_field_set))
|
||||
self.assertEqual(98, len(unknown_field_set))
|
||||
|
||||
def testCopyFrom(self):
|
||||
message = unittest_pb2.TestEmptyMessage()
|
||||
@ -306,7 +306,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase):
|
||||
self.empty_message.Clear()
|
||||
# All cleared, even unknown fields.
|
||||
self.assertEqual(self.empty_message.SerializeToString(), b'')
|
||||
self.assertEqual(len(unknown_field_set), 97)
|
||||
self.assertEqual(len(unknown_field_set), 98)
|
||||
|
||||
@unittest.skipIf((sys.version_info.major, sys.version_info.minor) < (3, 4),
|
||||
'tracemalloc requires python 3.4+')
|
||||
@ -365,7 +365,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase):
|
||||
def testUnknownExtensions(self):
|
||||
message = unittest_pb2.TestEmptyMessageWithExtensions()
|
||||
message.ParseFromString(self.all_fields_data)
|
||||
self.assertEqual(len(unknown_fields.UnknownFieldSet(message)), 97)
|
||||
self.assertEqual(len(message.UnknownFields()), 98)
|
||||
self.assertEqual(message.SerializeToString(), self.all_fields_data)
|
||||
|
||||
|
||||
|
@ -426,7 +426,7 @@ class FieldMaskTest(unittest.TestCase):
|
||||
mask = field_mask_pb2.FieldMask()
|
||||
msg_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
|
||||
mask.AllFieldsFromDescriptor(msg_descriptor)
|
||||
self.assertEqual(75, len(mask.paths))
|
||||
self.assertEqual(76, len(mask.paths))
|
||||
self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
|
||||
for field in msg_descriptor.fields:
|
||||
self.assertTrue(field.name in mask.paths)
|
||||
|
@ -43,10 +43,10 @@ from google.protobuf.internal import api_implementation
|
||||
from google.protobuf import descriptor_pool
|
||||
from google.protobuf import message
|
||||
|
||||
if api_implementation.Type() == 'cpp':
|
||||
from google.protobuf.pyext import cpp_message as message_impl
|
||||
else:
|
||||
if api_implementation.Type() == 'python':
|
||||
from google.protobuf.internal import python_message as message_impl
|
||||
else:
|
||||
from google.protobuf.pyext import cpp_message as message_impl # pylint: disable=g-import-not-at-top
|
||||
|
||||
|
||||
# The type of all Message classes.
|
||||
|
@ -38,9 +38,11 @@ __author__ = 'tibell@google.com (Johan Tibell)'
|
||||
|
||||
from google.protobuf.internal import api_implementation
|
||||
|
||||
if api_implementation._Version() == 3:
|
||||
from google3.third_party.upb.python import _message
|
||||
else:
|
||||
|
||||
# pylint: disable=protected-access
|
||||
_message = api_implementation._c_module
|
||||
# TODO(jieluo): Remove this import after fix api_implementation
|
||||
if _message is None:
|
||||
from google.protobuf.pyext import _message
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ Simple usage example:
|
||||
|
||||
|
||||
from google.protobuf.internal import api_implementation
|
||||
if api_implementation.Type() == 'cpp':
|
||||
if api_implementation.Type() != 'python':
|
||||
from google.protobuf.pyext import _message # pylint: disable=g-import-not-at-top
|
||||
else:
|
||||
from google.protobuf.internal import decoder # pylint: disable=g-import-not-at-top
|
||||
|
@ -1,6 +1,6 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "google-protobuf"
|
||||
s.version = "3.20.0"
|
||||
s.version = "3.20.1.rc.1"
|
||||
git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag
|
||||
s.licenses = ["BSD-3-Clause"]
|
||||
s.summary = "Protocol Buffers"
|
||||
|
@ -79,12 +79,25 @@ module Google
|
||||
|
||||
|
||||
def first(n=nil)
|
||||
n ? self[0...n] : self[0]
|
||||
if n.nil?
|
||||
return self[0]
|
||||
elsif n < 0
|
||||
raise ArgumentError, "negative array size"
|
||||
else
|
||||
return self[0...n]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def last(n=nil)
|
||||
n ? self[(self.size-n-1)..-1] : self[-1]
|
||||
if n.nil?
|
||||
return self[-1]
|
||||
elsif n < 0
|
||||
raise ArgumentError, "negative array size"
|
||||
else
|
||||
start = [self.size-n, 0].max
|
||||
return self[start...self.size]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<groupId>com.google.protobuf.jruby</groupId>
|
||||
<artifactId>protobuf-jruby</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
<name>Protocol Buffer JRuby native extension</name>
|
||||
<description>
|
||||
Protocol Buffers are a way of encoding structured data in an efficient yet
|
||||
@ -76,7 +76,7 @@
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
<version>3.20.0</version>
|
||||
<version>3.20.1-rc-1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jruby</groupId>
|
||||
|
@ -48,6 +48,10 @@ class RepeatedFieldTest < Test::Unit::TestCase
|
||||
assert_equal TestMessage2.new(:foo => 1), m.repeated_msg.first
|
||||
assert_equal :A, m.repeated_enum.first
|
||||
|
||||
err = assert_raises(ArgumentError) do
|
||||
m.repeated_int32.first(-1)
|
||||
end
|
||||
assert_equal "negative array size", err.message
|
||||
assert_equal [], m.repeated_int32.first(0)
|
||||
assert_equal [-10], m.repeated_int32.first(1)
|
||||
assert_equal [-10, -11], m.repeated_int32.first(2)
|
||||
@ -72,6 +76,15 @@ class RepeatedFieldTest < Test::Unit::TestCase
|
||||
assert_equal "foo".encode!('ASCII-8BIT'), m.repeated_bytes.last
|
||||
assert_equal TestMessage2.new(:foo => 2), m.repeated_msg.last
|
||||
assert_equal :B, m.repeated_enum.last
|
||||
|
||||
err = assert_raises(ArgumentError) do
|
||||
m.repeated_int32.last(-1)
|
||||
end
|
||||
assert_equal "negative array size", err.message
|
||||
assert_equal [], m.repeated_int32.last(0)
|
||||
assert_equal [-11], m.repeated_int32.last(1)
|
||||
assert_equal [-10, -11], m.repeated_int32.last(2)
|
||||
assert_equal [-10, -11], m.repeated_int32.last(3)
|
||||
end
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ else
|
||||
PTHREAD_DEF =
|
||||
endif
|
||||
|
||||
PROTOBUF_VERSION = 31:0:0
|
||||
PROTOBUF_VERSION = 31:1:0
|
||||
|
||||
if GCC
|
||||
# Turn on all warnings except for sign comparison (we ignore sign comparison
|
||||
@ -102,6 +102,7 @@ nobase_include_HEADERS = \
|
||||
google/protobuf/duration.pb.h \
|
||||
google/protobuf/dynamic_message.h \
|
||||
google/protobuf/empty.pb.h \
|
||||
google/protobuf/endian.h \
|
||||
google/protobuf/explicitly_constructed.h \
|
||||
google/protobuf/extension_set.h \
|
||||
google/protobuf/extension_set_inl.h \
|
||||
@ -142,6 +143,7 @@ nobase_include_HEADERS = \
|
||||
google/protobuf/port_def.inc \
|
||||
google/protobuf/port_undef.inc \
|
||||
google/protobuf/reflection.h \
|
||||
google/protobuf/reflection_internal.h \
|
||||
google/protobuf/reflection_ops.h \
|
||||
google/protobuf/repeated_field.h \
|
||||
google/protobuf/repeated_ptr_field.h \
|
||||
@ -259,7 +261,6 @@ libprotobuf_la_SOURCES = \
|
||||
google/protobuf/io/tokenizer.cc \
|
||||
google/protobuf/map_field.cc \
|
||||
google/protobuf/message.cc \
|
||||
google/protobuf/reflection_internal.h \
|
||||
google/protobuf/reflection_ops.cc \
|
||||
google/protobuf/service.cc \
|
||||
google/protobuf/source_context.pb.cc \
|
||||
|
@ -13,7 +13,7 @@
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3020000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
@ -109,10 +109,12 @@ class PROTOBUF_EXPORT Any final :
|
||||
// implements Any -----------------------------------------------
|
||||
|
||||
bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message) {
|
||||
GOOGLE_DCHECK_NE(&message, this);
|
||||
return _impl_._any_metadata_.PackFrom(GetArena(), message);
|
||||
}
|
||||
bool PackFrom(const ::PROTOBUF_NAMESPACE_ID::Message& message,
|
||||
::PROTOBUF_NAMESPACE_ID::ConstStringParam type_url_prefix) {
|
||||
GOOGLE_DCHECK_NE(&message, this);
|
||||
return _impl_._any_metadata_.PackFrom(GetArena(), message, type_url_prefix);
|
||||
}
|
||||
bool UnpackTo(::PROTOBUF_NAMESPACE_ID::Message* message) const {
|
||||
|
@ -176,6 +176,16 @@ TEST(AnyTest, MoveAssignment) {
|
||||
EXPECT_EQ(12345, payload.int32_value());
|
||||
}
|
||||
|
||||
#ifdef PROTOBUF_HAS_DEATH_TEST
|
||||
#ifndef NDEBUG
|
||||
TEST(AnyTest, PackSelfDeath) {
|
||||
google::protobuf::Any any;
|
||||
EXPECT_DEATH(any.PackFrom(any), "&message");
|
||||
EXPECT_DEATH(any.PackFrom(any, ""), "&message");
|
||||
}
|
||||
#endif // !NDEBUG
|
||||
#endif // PROTOBUF_HAS_DEATH_TEST
|
||||
|
||||
|
||||
} // namespace
|
||||
} // namespace protobuf
|
||||
|
@ -13,7 +13,7 @@
|
||||
#error incompatible with your Protocol Buffer headers. Please update
|
||||
#error your headers.
|
||||
#endif
|
||||
#if 3020000 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#if 3020001 < PROTOBUF_MIN_PROTOC_VERSION
|
||||
#error This file was generated by an older version of protoc which is
|
||||
#error incompatible with your Protocol Buffer headers. Please
|
||||
#error regenerate this file with a newer version of protoc.
|
||||
|
@ -55,13 +55,13 @@ void UnsampleSlow(ThreadSafeArenaStats* info) {
|
||||
namespace {
|
||||
|
||||
PROTOBUF_CONSTINIT std::atomic<bool> g_arenaz_enabled{true};
|
||||
PROTOBUF_CONSTINIT std::atomic<int32_t> g_arenaz_sample_parameter{1 << 15};
|
||||
PROTOBUF_CONSTINIT std::atomic<int32_t> g_arenaz_sample_parameter{1 << 10};
|
||||
PROTOBUF_THREAD_LOCAL absl::profiling_internal::ExponentialBiased
|
||||
g_exponential_biased_generator;
|
||||
|
||||
} // namespace
|
||||
|
||||
PROTOBUF_THREAD_LOCAL int64_t global_next_sample = 1LL << 15;
|
||||
PROTOBUF_THREAD_LOCAL int64_t global_next_sample = 1LL << 10;
|
||||
|
||||
ThreadSafeArenaStats::ThreadSafeArenaStats() { PrepareForSampling(); }
|
||||
ThreadSafeArenaStats::~ThreadSafeArenaStats() = default;
|
||||
|
@ -135,12 +135,10 @@ bool CppGenerator::Generate(const FileDescriptor* file,
|
||||
.insert(options[i].second.substr(pos, next_pos - pos));
|
||||
pos = next_pos + 1;
|
||||
} while (pos < options[i].second.size());
|
||||
} else if (options[i].first == "verified_lazy_message_sets") {
|
||||
file_options.unverified_lazy_message_sets = false;
|
||||
} else if (options[i].first == "verified_lazy") {
|
||||
file_options.unverified_lazy = false;
|
||||
} else if (options[i].first == "unverified_lazy_message_sets") {
|
||||
file_options.unverified_lazy_message_sets = true;
|
||||
} else if (options[i].first == "eagerly_verified_lazy") {
|
||||
file_options.eagerly_verified_lazy = true;
|
||||
} else if (options[i].first == "message_owned_arena_trial") {
|
||||
file_options.message_owned_arena_trial = true;
|
||||
} else if (options[i].first == "force_eagerly_verified_lazy") {
|
||||
|
@ -178,11 +178,6 @@ void SetIntVar(const Options& options, const std::string& type,
|
||||
std::map<std::string, std::string>* variables) {
|
||||
(*variables)[type] = IntTypeName(options, type);
|
||||
}
|
||||
bool IsEagerlyVerifiedLazyImpl(const FieldDescriptor* field,
|
||||
const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Returns true if the message can potentially allocate memory for its field.
|
||||
// This is used to determine if message-owned arena will be useful.
|
||||
@ -195,7 +190,23 @@ bool AllocExpected(const Descriptor* descriptor) {
|
||||
bool IsLazy(const FieldDescriptor* field, const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer) {
|
||||
return IsLazilyVerifiedLazy(field, options) ||
|
||||
IsEagerlyVerifiedLazyImpl(field, options, scc_analyzer);
|
||||
IsEagerlyVerifiedLazy(field, options, scc_analyzer);
|
||||
}
|
||||
|
||||
bool IsEagerlyVerifiedLazyByProfile(const FieldDescriptor* field,
|
||||
const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsEagerlyVerifiedLazy(const FieldDescriptor* field, const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsLazilyVerifiedLazy(const FieldDescriptor* field,
|
||||
const Options& options) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetCommonVars(const Options& options,
|
||||
|
@ -364,21 +364,16 @@ inline bool IsExplicitLazy(const FieldDescriptor* field) {
|
||||
return field->options().lazy() || field->options().unverified_lazy();
|
||||
}
|
||||
|
||||
inline bool IsLazilyVerifiedLazy(const FieldDescriptor* field,
|
||||
const Options& options) {
|
||||
// TODO(b/211906113): Make lazy() imply eagerly verified lazy.
|
||||
return IsExplicitLazy(field) && !field->is_repeated() &&
|
||||
field->type() == FieldDescriptor::TYPE_MESSAGE &&
|
||||
GetOptimizeFor(field->file(), options) != FileOptions::LITE_RUNTIME &&
|
||||
!options.opensource_runtime;
|
||||
}
|
||||
// Returns true if "field" is a message field that is backed by LazyField per
|
||||
// profile (go/pdlazy).
|
||||
bool IsEagerlyVerifiedLazyByProfile(const FieldDescriptor* field,
|
||||
const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer);
|
||||
|
||||
inline bool IsEagerlyVerifiedLazy(const FieldDescriptor* field,
|
||||
const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer) {
|
||||
// TODO(b/211906113): Make lazy() imply eagerly verified lazy.
|
||||
return IsLazy(field, options, scc_analyzer) && !IsExplicitLazy(field);
|
||||
}
|
||||
bool IsEagerlyVerifiedLazy(const FieldDescriptor* field, const Options& options,
|
||||
MessageSCCAnalyzer* scc_analyzer);
|
||||
|
||||
bool IsLazilyVerifiedLazy(const FieldDescriptor* field, const Options& options);
|
||||
|
||||
inline bool IsFieldUsed(const FieldDescriptor* /* field */,
|
||||
const Options& /* options */) {
|
||||
|
@ -1511,11 +1511,13 @@ void MessageGenerator::GenerateClassDefinition(io::Printer* printer) {
|
||||
if (HasDescriptorMethods(descriptor_->file(), options_)) {
|
||||
format(
|
||||
"bool PackFrom(const ::$proto_ns$::Message& message) {\n"
|
||||
" $DCHK$_NE(&message, this);\n"
|
||||
" return $any_metadata$.PackFrom(GetArena(), message);\n"
|
||||
"}\n"
|
||||
"bool PackFrom(const ::$proto_ns$::Message& message,\n"
|
||||
" ::PROTOBUF_NAMESPACE_ID::ConstStringParam "
|
||||
"type_url_prefix) {\n"
|
||||
" $DCHK$_NE(&message, this);\n"
|
||||
" return $any_metadata$.PackFrom(GetArena(), message, "
|
||||
"type_url_prefix);\n"
|
||||
"}\n"
|
||||
@ -2248,7 +2250,7 @@ std::pair<size_t, size_t> MessageGenerator::GenerateOffsets(
|
||||
//
|
||||
// Embed whether the field is eagerly verified lazy or inlined string to the
|
||||
// LSB of the offset.
|
||||
if (IsEagerlyVerifiedLazy(field, options_, scc_analyzer_)) {
|
||||
if (IsEagerlyVerifiedLazyByProfile(field, options_, scc_analyzer_)) {
|
||||
format(" | 0x1u // eagerly verified lazy\n");
|
||||
} else if (IsStringInlined(field, options_)) {
|
||||
format(" | 0x1u // inlined\n");
|
||||
|
@ -29,9 +29,9 @@
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <google/protobuf/unittest.pb.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
#include <gmock/gmock.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <google/protobuf/descriptor.h>
|
||||
|
||||
namespace google {
|
||||
namespace protobuf {
|
||||
|
@ -80,7 +80,7 @@ struct Options {
|
||||
bool annotate_accessor = false;
|
||||
bool unused_field_stripping = false;
|
||||
bool unverified_lazy_message_sets = false;
|
||||
bool eagerly_verified_lazy = true;
|
||||
bool unverified_lazy = true;
|
||||
bool profile_driven_inline_string = true;
|
||||
bool message_owned_arena_trial = false;
|
||||
bool force_split = false;
|
||||
|
@ -283,7 +283,7 @@ void ImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
io::Printer* printer) const {
|
||||
WriteFieldDocComment(printer, descriptor_);
|
||||
printer->Print(variables_,
|
||||
"$kt_deprecation$public var $kt_name$: $kt_type$\n"
|
||||
"$kt_deprecation$ var $kt_name$: $kt_type$\n"
|
||||
" @JvmName(\"${$get$kt_capitalized_name$$}$\")\n"
|
||||
" get() = $kt_dsl_builder$.${$get$capitalized_name$$}$()\n"
|
||||
" @JvmName(\"${$set$kt_capitalized_name$$}$\")\n"
|
||||
@ -294,7 +294,7 @@ void ImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
WriteFieldAccessorDocComment(printer, descriptor_, CLEARER,
|
||||
/* builder */ false);
|
||||
printer->Print(variables_,
|
||||
"public fun ${$clear$kt_capitalized_name$$}$() {\n"
|
||||
"fun ${$clear$kt_capitalized_name$$}$() {\n"
|
||||
" $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
|
||||
"}\n");
|
||||
|
||||
@ -302,7 +302,7 @@ void ImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
WriteFieldAccessorDocComment(printer, descriptor_, HAZZER);
|
||||
printer->Print(
|
||||
variables_,
|
||||
"public fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
|
||||
"fun ${$has$kt_capitalized_name$$}$(): kotlin.Boolean {\n"
|
||||
" return $kt_dsl_builder$.${$has$capitalized_name$$}$()\n"
|
||||
"}\n");
|
||||
}
|
||||
@ -1085,12 +1085,12 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
" */\n"
|
||||
"@kotlin.OptIn"
|
||||
"(com.google.protobuf.kotlin.OnlyForUseByGeneratedProtoCode::class)\n"
|
||||
"public class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
|
||||
"class ${$$kt_capitalized_name$Proxy$}$ private constructor()"
|
||||
" : com.google.protobuf.kotlin.DslProxy()\n");
|
||||
|
||||
WriteFieldDocComment(printer, descriptor_);
|
||||
printer->Print(variables_,
|
||||
"$kt_deprecation$ public val $kt_name$: "
|
||||
"$kt_deprecation$ val $kt_name$: "
|
||||
"com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>\n"
|
||||
" @kotlin.jvm.JvmSynthetic\n"
|
||||
@ -1103,7 +1103,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
printer->Print(variables_,
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"add$kt_capitalized_name$\")\n"
|
||||
"public fun com.google.protobuf.kotlin.DslList"
|
||||
"fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"add(value: $kt_type$) {\n"
|
||||
" $kt_dsl_builder$.${$add$capitalized_name$$}$(value)\n"
|
||||
@ -1115,7 +1115,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"plusAssign$kt_capitalized_name$\")\n"
|
||||
"@Suppress(\"NOTHING_TO_INLINE\")\n"
|
||||
"public inline operator fun com.google.protobuf.kotlin.DslList"
|
||||
"inline operator fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"plusAssign(value: $kt_type$) {\n"
|
||||
" add(value)\n"
|
||||
@ -1126,7 +1126,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
printer->Print(variables_,
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"addAll$kt_capitalized_name$\")\n"
|
||||
"public fun com.google.protobuf.kotlin.DslList"
|
||||
"fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"addAll(values: kotlin.collections.Iterable<$kt_type$>) {\n"
|
||||
" $kt_dsl_builder$.${$addAll$capitalized_name$$}$(values)\n"
|
||||
@ -1139,7 +1139,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"plusAssignAll$kt_capitalized_name$\")\n"
|
||||
"@Suppress(\"NOTHING_TO_INLINE\")\n"
|
||||
"public inline operator fun com.google.protobuf.kotlin.DslList"
|
||||
"inline operator fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"plusAssign(values: kotlin.collections.Iterable<$kt_type$>) {\n"
|
||||
" addAll(values)\n"
|
||||
@ -1151,7 +1151,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
variables_,
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"set$kt_capitalized_name$\")\n"
|
||||
"public operator fun com.google.protobuf.kotlin.DslList"
|
||||
"operator fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"set(index: kotlin.Int, value: $kt_type$) {\n"
|
||||
" $kt_dsl_builder$.${$set$capitalized_name$$}$(index, value)\n"
|
||||
@ -1162,7 +1162,7 @@ void RepeatedImmutableEnumFieldGenerator::GenerateKotlinDslMembers(
|
||||
printer->Print(variables_,
|
||||
"@kotlin.jvm.JvmSynthetic\n"
|
||||
"@kotlin.jvm.JvmName(\"clear$kt_capitalized_name$\")\n"
|
||||
"public fun com.google.protobuf.kotlin.DslList"
|
||||
"fun com.google.protobuf.kotlin.DslList"
|
||||
"<$kt_type$, ${$$kt_capitalized_name$Proxy$}$>."
|
||||
"clear() {\n"
|
||||
" $kt_dsl_builder$.${$clear$capitalized_name$$}$()\n"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user