Commit Graph

765 Commits

Author SHA1 Message Date
Hao Nguyen
582927ae2a Update generated files 2019-05-21 16:42:33 -07:00
Hao Nguyen
b0d648664d Update protobuf version 2019-05-21 14:07:13 -07:00
Hao Nguyen
2352a30e66 Revert "Update protobuf version"
This reverts commit 6d96493b31.
2019-05-21 13:49:06 -07:00
Hao Nguyen
6d96493b31 Update protobuf version 2019-05-21 13:31:01 -07:00
Sydney Acksman
9e89b6e70a C# Proto2 feature : Extensions (#5350)
* Compiler changes (extensions)

* Generated changes (extensions)

* Library changes (extensions)

* Adjusted a summary to indicate ContainingType can be null for extensions

* Compiler changes (custom option review + access level review)

* Generated code changes (custom options + access review)

* Library changes (custom options + access review)

* Support C# 6 with library changes

* Access HasValue by property

* Set access level of all extension classes to internal (revert in next PR)

* Added null checks to custom options

* Rebase on master and regenerate Conformance

* Removed second dictionary from ExtensionSet

* Rebased compiler changes

* Rebased generated code changes

* Rebased library changes + review changes

* Add more safety checks to extension accessors

* Remove instances where extension sets were unnecessarily allocated

* Remove cleared items from sets
Empty sets are now made null
IExtensionMessage -> IExtendableMessage

* Remove dead code from IExtensionValue impls

* Clean both repeated and single value extensions

* Add GetOrRegister method for repeated fields and allow clearing repeated extensions

* Add type safe ClearExtension methods, remove non-generic IExtendableMessage interface.

* Simplify ExtensionSet.TryMergeFieldFrom

* Rebase on master to resolve conflicts

* Fix Makefile.am

* Add ObjectIntPair to Makefile.am
2019-05-03 13:54:41 -07:00
Hao Nguyen
37a89f8e1a Update version to 3.8.0 2019-04-23 16:14:52 -07:00
Hao Nguyen
3d69bad4b2 Update generated proto and remove a test from failure_list 2019-04-10 13:33:56 -07:00
Hao Nguyen
ef1e8e7172 Add module for JavaLite and fix builds 2019-04-09 06:48:01 -07:00
Adam Cozzette
8645d893ab Merge branch '3.7.x' into merge-3-7-x 2019-03-26 14:32:20 -07:00
Paul Yang
6973c3a504
Update version number to 3.7.1 (#5947)
* Update version number to 3.7.1

* Update version number in port_def.inc
2019-03-26 09:30:12 -07:00
Hao Nguyen
71f2996d7c Update generated descriptor files 2019-03-20 15:39:36 -07:00
Jan Tattermusch
ec3d94819d add System.Memory dependency (#5835)
also add useful Span-based methods for ByteString
2019-03-18 16:28:02 -07:00
Jon Skeet
2de68bc33a Make the C# benchmarks non-packable 2019-03-15 09:39:50 +00:00
Jan Tattermusch
f071c9e0f3 fix source stepping by upgrading sourcelink (#5891) 2019-03-14 14:58:35 -07:00
Jon Skeet
233f4865ee First pass at benchmarking for C# 2019-03-13 15:26:57 +00:00
Paul Yang
4b145b1c7f
Parse nested listvalue in json for ruby (#5867)
* Add conformance test for nested listvalue

* Fix upb for parsing repeated Value/ListValue

* Add failed repeated ListValue conformance test into php failure list
2019-03-12 10:56:58 -07:00
Jan Tattermusch
60a889e048 make check for distinct hashcode optional 2019-03-12 08:56:32 -04:00
Jan Tattermusch
e6a22c9777 test all frameworks on windows 2019-03-12 05:17:13 -04:00
Jan Tattermusch
753daae027 use netcoreapp2.1 for testing 2019-03-12 05:16:52 -04:00
Jan Tattermusch
79c32b17ac add scripts for C# windows tests 2019-03-12 05:16:52 -04:00
Sydney Acksman
15fab9109d Bump target frameworks of C# programs from netcoreapp1.0 to netcoreapp2.1 (#5838)
* Bump target frameworks from netcoreapp1.0 to netcoreapp2.2.
Move global.json up to root of repo, change SDK ver to 2.2.100
Change .net core sdk in dockerfile for kokoro to ver 2.2.100

* Re-add curl install

* Change all exe target to 2.1

* Fix incorrect versions in global.json and Dockerfile

* Downgrade version to 2.1 to match exe targets

* introduce separate testing Dockerfile for C#

* revert changes to the shared Dockerfile

* use netcoreapp2.1 for C# conformance tests

* use language specific dockerfile for testing C#

* Edit compatibility tests script to use parameters instead of file copies

* install dotnet SDK on windows before running the tests

* update csharp_EXTRA_DIST
2019-03-11 13:03:58 -07:00
WilliamWhispell
59284450fa Use fixed size for bool, float and double field in codec (#5810)
* Improve C# serialization performance of repeated fields for primitives.

* Changes based on feedback.

* Change compatibility tests to chec float, bool and double are fixed

* Changes based on feedback.

* In the compute methods use the newly created constants
2019-03-08 14:35:21 -08:00
Bo Yang
cb6fa92ee8 Merge branch '3.7.x' 2019-03-04 10:18:18 -08:00
Paul Yang
582743bf40
Update version number to 3.7.0 (#5793)
* Update version number to 3.7.0

* Add php/releash.sh to Makefile.am

* Make cpp_distcheck exit on fail
2019-02-28 12:55:14 -08:00
Paul Yang
bf32b36ab8
Merge pull request #5765 from BSBandme/integration
down integration from internal
2019-02-26 22:11:08 -08:00
Sydney Acksman
a4c3472ce8 Add some exceptions for MessageParser.ParseFrom (#5588)
* Fix #5513

* Added tests for invalid lengths when reading strings and bytes.
Added test for reading tags with invalid wire types in unknown field set.
Changed invalid length check in ReadString to match the one in ReadBytes
2019-02-26 15:31:29 -08:00
Yilun Chong
6d29c22a43 fix conformance test for text format 2019-02-26 13:46:30 -08:00
Yilun Chong
af8b91b828 fix csharp by regenerate descriptor 2019-02-26 13:07:59 -08:00
Yilun Chong
e4e5bc49d7
Fix failure test by regenerating descriptor and revert golden file (#5762) 2019-02-24 17:09:49 -08:00
Bo Yang
b52754b719 Update version to 3.7.0rc3 2019-02-22 11:31:48 -08:00
Xiang Dai
e479410564 delete all duplicate empty blanks (#5758)
Signed-off-by: Xiang Dai <764524258@qq.com>
2019-02-20 19:28:50 -08:00
Paul Yang
c7b3392201
Update version to 3.7.0 (#5749)
* Update version to 3.7.0

* Update version number for java bom
2019-02-19 15:54:45 -08:00
Sydney Acksman
e7283254d6 Change MessageType != null in IsInitialized to FieldType == Message || Group (#5688) 2019-02-14 11:34:15 -08:00
Sydney Acksman
dbf77c65c4 Refactor how group endings are detected in generated C# code (#5686)
* Modify how end tags are encounted in merge code (compiler)

* Modify how end tags are encounted in merge code (generated)

* Modify how end tags are encounted in merge code (library)

* Regenerate generated code through generate_descriptor_proto.sh
2019-02-11 15:14:43 -08:00
Sydney Acksman
2a05691a53 Refactor how group endings are detected in generated C# code (#5686)
* Modify how end tags are encounted in merge code (compiler)

* Modify how end tags are encounted in merge code (generated)

* Modify how end tags are encounted in merge code (library)

* Regenerate generated code through generate_descriptor_proto.sh
2019-02-11 15:12:40 -08:00
Adam Cozzette
1ee15baefc Updated version to 3.7.0rc2 2019-01-30 21:08:04 -08:00
Hao Nguyen
d5be2baa46 Update version to 3.7.0 2019-01-24 10:23:02 -08:00
Yilun Chong
a2a0afb546
Down-integrate internal changes to github. (#5575)
* Down-integrate internal changes to github.

* Fix BUILD file and regenerate csharp descritpor
2019-01-13 17:40:58 -08:00
Yilun Chong
cb95a7f6a8
Down-integrate internal changes to github. (#5566)
* Down-integrate internal changes to github.

* fix csharp conformance test

* add comments in conformance.proto for text format

* fix comments

* fix comments, re-generated csharp file

* fix comments, re-generated csharp file
2019-01-11 11:40:52 -08:00
Thomas Van Lenten
b1b9eaa6c7 Comments on the next line will go to the next field.
Even though the comments were indented to appear to go with the jspb
case/field, protoc doesn't collect comments like that, so these "hanging"
comments actually "attach" to the next thing added to each.  Looking at
https://github.com/protocolbuffers/protobuf/pull/5566 you see where
the generated code picked up the comment on the wrong field.
2019-01-10 13:14:21 -05:00
Yilun Chong
0adb74c2d3 Down-integrate internal changes to github. (#5555)
* Down-integrate internal changes to github.

* fix python conformance test

* fix csharp conformance test

* add back java map_lite_test.proto's optimize for option

* fix php conformance test
2019-01-08 15:06:30 -08:00
Bo Yang
624a40a387 Down-integrate internal changes to github. 2018-12-20 14:21:20 -08:00
Paul Yang
cecba296b8
Down-integrate internal changes (#5467)
* Down-integrate internal changes

* Update generated code for php, objc and csharp.

* Add missing dependency in conformance_php
2018-12-14 16:05:03 -08:00
Hao Nguyen
4b02f652e0 Make sure to add a new line at the end of XML files 2018-12-14 15:10:11 -08:00
Hao Nguyen
9349e23827 Replace update_version shell script with a python script, which is much better at handling XML rewrite. Update the PHP version too. As part of rewrite, some XML file format will change a little, but the semantics is still the same so it should be okay. 2018-12-14 15:05:48 -08:00
Hao Nguyen
db0a9e0b96 Add <LangVersion>6</LangVersion> to the core protobuf C# project to prevent future incompatibility 2018-12-10 15:21:01 -08:00
Hao Nguyen
3d207c33a4 Fix TimestampPartial operator == overload implementation: Cannot call == inside it, otherwise it would cause stack overflow 2018-12-10 13:41:15 -08:00
Hao Nguyen
24638088c6 Make Protobuf compatible with C# 6 2018-12-10 10:22:41 -08:00
Jon Skeet
627cc48f5a Increase C# default recursion limit to 100 (#5339)
* Increase C# default recursion limit to 100

This matches the Java and C++ defaults.

* Change compatibility tests to use execution-time default recursion limit

This way the same tests should pass against all versions, even
if the recursion limit changes. (The tests will be testing whether
different messages work, admittedly - but that's probably fine.)
2018-11-13 10:21:30 -08:00
Adam Cozzette
86d4fe47df Updated checked-in generated code 2018-11-09 11:35:34 -08:00
Sydney Acksman
6f73c50936 C# Proto2 feature : Groups (#5183)
Add group support for proto2
2018-11-05 13:37:08 -08:00
Benjamin Krämer
80e530dabf Ported FieldMaskUtil from Java to C# (#5045)
* Ported FieldMaskUtil from Java to C#

* Merged FieldMaskUtil into FieldMaskPartial

- Removed FieldMaskUtil
- Moved FieldMaskTree to root
- Updated tests

* Improved tests

- Removed internal method FieldMaskTree.GetFieldPaths
- Proof FieldMask.Paths only contains expected values

* Added FieldMaskTreeTest to Makefile

* Added FieldMaskTree to Makefile
2018-10-08 12:54:05 -07:00
Sydney Acksman
3f826a6dbf Add method for Any.Is (#5207) 2018-10-05 11:06:58 -07:00
Adam Cozzette
4426cb5733
Merge pull request #5172 from shields/smear-comments
Smear comments
2018-09-24 13:52:52 -07:00
Sydney Acksman
54176b26a9 C# Proto2 feature : Field presence and default values (#4642)
* Compiler changes

* Generated code changes

* Library changes

* Compiler style changes

* Generated style changes

* Fix Windows build errors

* Implement changes from review

* Reintroduce proto2 check

* Compiler changes (required handling review)

* Generated code changes (required handling review)

* Library changes (required handling review

* Field presence rewrite (compiler changes)

* Field presence rewrite (generated code changes)

* Compiler comment

* IFieldAccessor.HasValue library implementation

* Remove Clear methods and default values from proto3 code (Compiler)

* Remove Clear methods and default values from proto3 code (Generated)

* Remove Clear methods and default values from proto3 code (Library)

* Fix distcheck error

* Rewrite default string values to use base64 and convert

* Library changes (IMessage2)

* Compiler changes (IMessage2)

* Generated changes (IMessage2)

* Rebased and regenerated

* Compiler changes (initialized extension)

* Generated changes (initialized extension)

* Library changes (initialized extension)

* Refactor MessageExtensions.IsRequired

* Move string default value creator and bytes default value creator back to seperate methods

* Dead code cleanup

* Fixed segmentation fault
Removed unused header method declarations
2018-09-24 13:42:24 -07:00
Jon Skeet
47d33e752e Test locations, and add comment to clarify testing 2018-09-22 09:09:15 +01:00
Jon Skeet
6e39eaad3c Add more detailed comments for declaration properties 2018-09-22 09:09:15 +01:00
Jon Skeet
1376ee4e6a Simplify descriptor tests
Rather than converting the proto to a ByteString again, use the
existing SerializedData property.
2018-09-22 09:09:15 +01:00
Jon Skeet
988b381c83 Add comment about FileDescriptor not exposing a declaration 2018-09-22 09:09:15 +01:00
Jon Skeet
1711999078 Provide simple access to descriptor declarations in C#
This is primarily for access to comments, which would be expected to be available in a protoc plugin.

The implementation has two fiddly aspects:

- We use a Lazy<T> to avoid building the map before cross-linking. An alternative would be to crosslink at the end of the constructor, and remove the calls to CrossLink elsewhere. This would be generally better IMO, but deviate from the Java code.
- The casts to IReadOnlyList<DescriptorBase> are unfortunate. They'll always work, because these lists are always ReadOnlyCollection<T> for a descriptor type... but we can't use IList<DescriptorBase> as that's not covariant, and it's annoyingly fiddly to change the field to be of type ReadOnlyCollection<T>.
2018-09-22 09:09:15 +01:00
Michael Shields
10360e342f Regenerate C# and Objective-C. 2018-09-19 12:54:57 -07:00
Jon Skeet
baa4a21130 Cross-link descriptor when building from byte strings
This performs more testing for field descriptors built from byte
strings too, but that's mostly incidental. The chief intent is to
check that cross-linking occurs.
2018-09-10 22:00:36 +01:00
Josh Haberman
c73d689c95 Regenerated C# protos. 2018-09-04 11:49:04 -07:00
Feng Xiao
afe98de32a Replace repo links. 2018-08-22 11:55:30 -07:00
Jon Skeet
228530e2da Support creating FileDescriptors dynamically from binary data.
Related to #658 and #5007.
2018-08-20 22:00:02 +01:00
Feng Xiao
a4862e790e Update generated descriptors. 2018-08-08 17:21:04 -07:00
Adam Cozzette
94d55e5292 Merge branch '3.6.x' into merge-3-6-x 2018-08-01 13:44:55 -07:00
Adam Cozzette
9e1286b949 Updated version numbers to 3.6.1 2018-07-27 13:30:28 -07:00
Paul Yang
8705adc228
Give a specific category to each test. (#4965)
* Give a unique category to each test.

This change introduce a TestCategory enum to ConformanceRequest. Existing tests
are divided into three categories: binary format test, json format test and json
format (ignore unknown when parsing) test. For the previous two categories, there
is no change to existing testee programs. For tests with the last category, testee programs
should either enable ignoring unknown field during json parsing or skip the test.

* Fix python test

* Fix java

* Fix csharp

* Update document

* Update csharp generated code
2018-07-27 12:24:42 -07:00
Jan Tattermusch
f50be7de91 Fix C# nuget build on Kokoro (#4912)
* upgrade dotnet SDK to 2.1.3 on kokoro linux
2018-07-18 11:04:59 -07:00
Paul Yang
26eeec93e4
Enable ignoring unknown in json parsing in php (#4839)
* Enable ignoring unknown in json parsing in php

* Update generated descriptor files

* Update failure list for other languages.

* Remove unnecessary php files
2018-07-09 14:29:23 -07:00
Warren Falk
96833b8f4b implement IComparable and comparison operators on Timestamp (#4318) 2018-07-09 14:26:36 -07:00
Adam Cozzette
d6f346b4d5
Merge pull request #4827 from acozzette/merge-3-6-x
Merge 3.6.x branch into master
2018-06-25 15:52:29 -07:00
Sydney Acksman
3d603f481e Remove protoc conditional properties (#4817)
* Remove protoc conditional properties

* Fix duplicate brace
2018-06-25 15:21:30 -07:00
Adam Cozzette
82d3d7d250 Merge branch '3.6.x' into merge-3-6-x 2018-06-25 13:22:10 -07:00
Sebastian Schuberth
ee03556df9 Remove the executable bit from several source code files
This potentially avoids compiler warnings.
2018-06-25 08:17:39 +02:00
Sydney Acksman
1f77342b78 Add msbuild targets to C# tools for protoc compilers (#4648)
* Added props to C# tools

* Add targets file to makefile.am
2018-06-21 14:53:31 -07:00
Adam Cozzette
9d64d740a1 Removed duplicate using statement from ReflectionUtil.cs 2018-05-29 14:29:59 -07:00
Jisi Liu
45eb28b588 Update version number to 3.6.0 2018-05-14 16:06:22 -07:00
Cameron Taggart
394866c002 enable source link for csharp (#4179) 2018-05-14 13:46:03 -07:00
Paul Yang
b61dd9d9a2
Add file option php_metadata_namespace and ruby_package (#4609) 2018-05-11 13:57:06 -07:00
David Chennells
513b35dc4e Add VS2017 optional component dependency details to the C# readme (#4128)
Add mention to the "Build" section of the ReadMe of the requirement of installing an optional component to VS2017.
2018-05-03 15:59:36 -07:00
Jon Skeet
1b219a174c Fix to allow AOT compilers to play nicely with reflection
With this fix, Unity using IL2CPP should work with one of two
approaches:

- Call `FileDescriptor.ForceReflectionInitialization<T>` for every
  enum present in generated code (including oneof case enums)
- Ensure that IL2CPP uses the same code for int and any int-based
  enums

The former approach is likely to be simpler, unless IL2CPP changes
its default behavior. We *could* potentially generate the code
automatically, but that makes me slightly uncomfortable in terms of
generating code that's only relevant in one specific scenario. It
would be reasonably easy to write a tool (separate from protoc) to
generate the code required for any specific set of assemblies, so
that Unity users can include it in their application. We can always
decide to change to generate it automatically later.
2018-04-27 16:47:46 +01:00
Sydney Acksman
4ca46ede5c Write messages to backing field in generated C# cloning code (#4440)
* Edited MessageFieldGenerator to clone to backing field instead of property

* Generated C# proto code
2018-04-19 11:57:31 -07:00
Jon Skeet
da3ce67171 Deliberately call simple code to avoid Unity linker pruning
The SampleEnumMethod method was previously only called via
reflection, so the Unity linker thought it could be removed. Ditto
the parameterless constructor in ReflectionHelper.

This PR should avoid that issue, reducing the work needed by
customers to use Google.Protobuf from Unity.
2018-04-06 08:05:32 +01:00
Feng Xiao
e7e6c6b8d1
Merge pull request #4283 from ObsidianMinor/csharp/better-test-runners
[C#] Update test project to be used with dotnet test and Visual Studio Test Explorer
2018-04-04 17:01:09 -07:00
ObsidianMinor
f72ac9f987 Updated csharp/README.md to reflect testing changes 2018-04-04 16:04:12 -05:00
Paul Yang
c931743461
Merge branch (#4466)
* Fix setup.py for windows build.

* Bump version number to 3.5.2

* Cat the test-suite.log on errors for presubits
2018-04-02 15:55:28 -07:00
Jon Skeet
9c05c35341 Address review comments 2018-03-27 10:17:44 +01:00
Jon Skeet
8e23d4e49c Work around an "old runtime" issue with reflection
For oneofs, to get the case, we need to call the property that
returns the enum value. We really want it as an int, and modern
runtimes allow us to create a delegate which returns an int from the
method. (I suspect that the MS runtime has always allowed that.)
Old versions of Mono (e.g. used by Unity3d) don't allow that, so we
have to convert the enum value to an int via boxing. It's ugly, but
it should work.
2018-03-27 08:42:27 +01:00
Jon Skeet
aa59eaa77b Introduce a compatiblity shim to support .NET 3.5 delegate creation 2018-03-27 08:42:27 +01:00
Jon Skeet
8ba420f040 Change C# reflection to avoid using expression trees
This should work on Unity, Mono and .NET 3.5 as far as I'm aware.
It won't work on platforms where reflection itself is prohibited,
but that's a non-starter basically.
2018-03-27 08:42:26 +01:00
Adam Cozzette
ed4321d1cb
Merge pull request #4387 from acozzette/down-integrate
Integrated internal changes from Google
2018-03-20 16:14:32 -07:00
Feng Xiao
88a4884b55
Merge pull request #4345 from jskeet/list-json-null
Allow null value in JSON representation of ListValue
2018-03-20 15:19:42 -07:00
Adam Cozzette
b1216d95db Updated checked-in generated code 2018-03-14 11:17:06 -07:00
Jon Skeet
822b924d59 Allow list values to be null when parsing 2018-03-01 13:20:40 +00:00
ObsidianMinor
e823897005 Updated NUnit packages, removed NUnitLite added packages for dotnet and Visual Studio, changed dotnet command in buildall to dotnet test, and deleted Program.cs (because it's no longer required). 2018-02-06 12:59:20 -06:00
John Brock
864df890a7 Remove 64MB memory limit when deserializing messages in C#
Increased `CodedInputStream.DefaultSizeLimit` to `Int32.MaxValue` to make it consistent with the Java implementation.
2018-01-31 14:08:02 -08:00
Jon Skeet
0c52335587 Update .NET SDK to 2.0.3
This will allow SourceLink as per #4179, and mean that we can use C#
7.0 language features in the library (but not in generated code).
This does not affect which platforms we're *targeting*, so end users
won't see any difference.

It would be nice to update to 2.1.4, but AppVeyor's "Visual Studio
2017" environment is only 2.0.3.
2018-01-25 19:42:15 +00:00
Jon Skeet
47b7d2c7ca Add DiscardUnknownFields support for C#
By default, unknown fields are preserved when parsing. To discard
them, use a parser configured to do so:

var parser = MyMessage.Parser.WithDiscardUnknownFields(true);
2018-01-15 02:53:45 -05:00
Jisi Liu
383a4941d5 Merge remote-tracking branch 'origin/3.5.x' into master 2018-01-03 09:28:40 -08:00
Jisi Liu
d106399d39
Merge pull request #4072 from google/jieluo
Cherrypick for csharp, including:
2017-12-19 17:45:56 -08:00
Jie Luo
b308580bb1 Cherrypick for csharp, including:
Add preserve UnknownFields
Compare floating point values bitwise
Add auto-generated header to C# generated files
2017-12-19 15:38:02 -08:00
Jisi Liu
050fc9a437 Update version number to 3.5.1 2017-12-19 11:00:33 -08:00
Jan Tattermusch
426cf6f31e Add auto-generated header to C# generated files (#4038)
* Add auto-generated header to C# generated files

* regenerate C# protos
2017-12-13 14:36:29 -08:00
Jie Luo
bfd254e14f
Add unknown field support for csharp (#3936)
Add unknown field support for csharp
2017-12-13 13:48:58 -08:00
Feng Xiao
75eceb8424 Update generated code. 2017-12-12 14:57:34 -08:00
Jon Skeet
31c54d1289 Regenerated code from previous C# codegen commit
With this in place, all tests should pass.

Fixes #3725.
2017-12-09 09:49:24 +00:00
Jon Skeet
f3e9a65d75 Compare floating point values bitwise in C#
This is the manual code part of the Google.Protobuf library, and tests.
Some tests will fail until codegen is changed and rerun.
2017-12-09 09:49:24 +00:00
Adam Cozzette
0ba8eea655 Merge branch 'master' into down-integrate 2017-12-01 10:05:19 -08:00
Adam Cozzette
92a7e778e7 Integrated internal changes from Google 2017-12-01 10:05:10 -08:00
Adam Cozzette
a27da09339 Merge branch '3.5.x' into 3.5.x-merge 2017-11-30 13:34:51 -08:00
Jie Luo
6d6099553b
Update csharp version number (#3958) 2017-11-29 16:10:44 -08:00
Jon Skeet
74f64b667c Fix JsonTokenizer exception message 2017-11-29 07:14:57 +00:00
Jon Skeet
91ff83c024 Remove non-C# options from C#-only test protos 2017-11-14 07:31:59 +00:00
Jon Skeet
8cf53f8dfc MMinor fix-ups to C# tests from changes in earlier commits 2017-11-12 15:29:15 +00:00
Jon Skeet
b5cdf0eac6 Regenerated test code for C# 2017-11-12 15:29:15 +00:00
Jon Skeet
aa77eab622 Move C#-only test protos to csharp/protos
unittest_proto3 had been changed in a very backward-incompatible
way which was never going to work with C# as it imports proto2 messages.

This is now a copy of the old file, but with a package name change for
compatibility with the remaining files in src/google/protobuf.

The other moves are for files that are only used by C#.
2017-11-12 15:29:15 +00:00
Jan Tattermusch
5f96191459 ParseFrom<T> for array slice is missing 2017-11-10 09:01:32 +01:00
Jan Tattermusch
4a5e1bd043 check already performed by MergeFrom 2017-11-10 09:01:07 +01:00
Jan Tattermusch
435f61102b allow message parsing from an array slice 2017-11-10 09:00:52 +01:00
Jan Tattermusch
30b6e54327 ParseFrom<T> for array slice is missing 2017-11-09 18:33:15 +01:00
Jan Tattermusch
07542e78da check already performed by MergeFrom 2017-11-09 18:27:45 +01:00
Jan Tattermusch
0c874a6a19 allow message parsing from an array slice 2017-11-09 14:23:14 +01:00
Jisi Liu
97dd175a91 Update version number to 3.5.0 2017-11-02 14:16:22 -07:00
Jon Skeet
cbe250591f Fix merging with message-valued oneof
If messages A and B have the same oneof case, which is a message
type, and we merge B into A, those sub-messages should be merged.

Fixes #3200.

Note that I haven't regenerated all the code, as some of the protos
have been changed, breaking generation.
2017-10-31 17:11:40 -07:00
xuwei-k
05b56d01c1 update joda-time javadoc url 2017-10-30 17:48:54 +09:00
Jon Skeet
e8c9ae1209 Add parser settings WithXyz methods 2017-10-28 07:47:43 +01:00
Jon Skeet
a985451253 Add JsonParser setting to ignore unknown field values
Note that the default behavior is still to throw an exception; you
need to opt into ignoring unknown fields.

Fixes #2838.
2017-10-28 07:47:43 +01:00
Jisi Liu
ecf2957106 Update descriptor protos 2017-10-18 14:21:22 -07:00
Jisi Liu
de15e73d58 Merge remote-tracking branch 'origin/3.4.x' into master 2017-10-11 14:44:03 -07:00
Jisi Liu
dba647a6b2 Bump version for minor release 2017-09-14 11:12:55 -07:00
Adam Cozzette
13fd045dbb Integrated internal changes from Google 2017-09-14 10:03:57 -07:00
Jan Tattermusch
5de05654aa Google.Protobuf should target net45 2017-09-12 11:56:34 +02:00
Feng Xiao
49b31dc5f7 Update C# generated file for addressbook.proto 2017-09-11 14:43:14 -07:00
Jan Tattermusch
50a64759dd Google.Protobuf should target net45 2017-09-05 17:59:03 +02:00
Paul Yang
2807436cd8 change the field number of php_generic_service to fix the conflict with (#3576)
internal descriptor.proto
2017-08-30 16:50:07 -07:00
Jisi Liu
139775ccc0 Merge remote-tracking branch 'origin/3.4.x' into mergemaster 2017-08-18 16:25:35 -07:00
Jon Skeet
e0d24cc84a Detect invalid tags with a field number of 0 in C#
Previously we only rejected the tag if the tag itself was 0, i.e.
field=0, type=varint. The type doesn't matter: field 0 is always
invalid.

This removes the last of the C# conformance failures.
2017-08-11 19:33:53 +01:00
Bo Yang
8f4b8e430a Merge branch 'master' into 3.4.x 2017-08-05 10:42:29 -07:00
Jisi Liu
6c64f11778 Bump csharp version 2017-08-02 13:20:13 -07:00
Thomas Van Lenten
9a4692d8af Update the comment on the message_type to cover what it should be. 2017-07-26 17:07:01 -04:00
Jisi Liu
759245a49a Merge from master 2017-07-25 11:52:33 -07:00
Jisi Liu
7bb39bef1a Update version number for 3.4.0 2017-07-24 16:03:49 -07:00
Yilun Chong
a713b73076 Merge pull request #3281 from BSBandme/ConformanceTestYilunChong
Proto2 test message support to conformance test
2017-07-24 14:50:52 -07:00
Paul Yang
50aa4febaf Merge pull request #3375 from TeBoring/3.3.x
Merge 3.3.x into master
2017-07-19 06:58:05 -07:00
Jisi Liu
3af881c7e2 Merge master into 3.4.x 2017-07-18 16:26:16 -07:00
Jisi Liu
86975301f1 Update csharp and php descriptor 2017-07-18 15:44:24 -07:00
Bo Yang
6ec0b7e4d1 Merge 3.3.x into master 2017-07-18 11:06:16 -07:00
Matt A
9e745f771b Support PHP generic services (#3269)
* Add php_generic_services option

* Generate PHP generic services

* Respect namespaces for generated PHP services

* Test PHP generated services

* Rename PHP generator service method doc comment function

* Correct phpdoc service method case

* Test namespaced PHP generic services

* Always use the FQCN for PHP generic service input/output

* Add generated_service_test to php test.sh

* Add php service test protos to CI

* Add php service files to php_EXTRA_DIST

* Use Interface suffix for php generic services
2017-07-18 07:45:18 -07:00
Jon Skeet
71f2f0d76c Fix repository URL in C# project file 2017-07-13 14:03:56 +01:00
Jean-Rémy Bancel
727c0dc1fa C#: Implement IReadOnlyDictionary<K,V> in MapField<K,V> 2017-07-12 09:28:43 +01:00
Yilun Chong
7339c25d12 delete backup files 2017-07-05 09:49:11 -07:00
Yilun Chong
cbf7dfb323 fix php failing list and csharp generated proto 2017-07-05 09:48:40 -07:00
Jon Skeet
cdd524a0bd Ensure leaveOpen is true when writing to a buffer
Note that the compatibility tests have had to cahnge as well, to
cope with internal changes. (The test project has access to
internals in the main project.)

Fixes #3209.
2017-07-04 06:42:45 +01:00
Jon Skeet
62d7fe5697 Make Any easier to work with in C#
- Add a TryUnpack method which doesn't throw if the type is wrong
- Make GetTypeName public for easier determination of the message type

Fixes #3294.
2017-07-03 12:16:40 +01:00
Yilun Chong
3adb054bbf add some test proto2 supported, add js proto2 supported, fixed some error 2017-06-30 17:22:32 -07:00
Yilun Chong
a7d5be6a91 change php objc nodejs csharp ruby 2017-06-29 15:04:50 -07:00
Yilun Chong
467c1ccd25 fix csharp conformance test 2017-06-28 15:44:14 -07:00
Yilun Chong
db379e6e69 fix csharp conformance test 2017-06-28 15:32:59 -07:00
Yilun Chong
ff773c1aaf fix csharp 2017-06-28 14:55:30 -07:00
Yilun Chong
cd1dc3f0df add csharp support 2017-06-28 14:51:56 -07:00
Bo Yang
e7bcfc4241 Update version number to 3.3.2 2017-06-21 10:20:34 -07:00
Paul Yang
6f325805c0 Add new file option php_namespace. (#3162)
* Add new file option php_namespace.

Use this option to change the namespace of php generated classes.
Default is empty. When this option is empty, the package name will be
used for determining the namespace.

* Uncomment commented tests

* Revert gdb test change

* Update csharp descriptor.

* Add test for empty php_namespace.
2017-06-05 00:10:18 -07:00
John Brock
95749d5af6 update csharp README and fix .NET 3.5 build error 2017-05-25 20:20:31 +01:00
Jon Skeet
0b07d7eb9e Add IncludeSource in csproj as per review comments 2017-05-24 09:07:33 +01:00
Jon Skeet
f26e8c2ae0 Convert C# projects to MSBuild (csproj) format
This has one important packaging change: the netstandard version now
depends (implicitly) on netstandard1.6.1 rather than on individual
packages. This is the preferred style of dependency, and shouldn't
affect any users - see http://stackoverflow.com/questions/42946951
for details.

The tests are still NUnit, but NUnit doesn't support "dotnet test"
yet; the test project is now an executable using NUnitLite. (When
NUnit supports dotnet test, we can adapt to it.)

Note that the project will now only work in Visual Studio 2017 (and
Visual Studio Code, and from the command line with the .NET Core
1.0.0 SDK); Visual Studio 2015 does *not* support this project file
format.
2017-05-24 09:07:33 +01:00
Feng Xiao
58538ea919 Update version number to 3.3.1 2017-05-08 16:02:08 -07:00
Feng Xiao
80f0c0ac40 Update version number and changelog for 3.3.0 2017-04-05 17:32:17 -07:00
Feng Xiao
32d7830e4b Fix C++ build for down-integration. 2017-03-29 14:52:33 -07:00
Jie Luo
7610f101e8 Merge pull request #2884 from anandolee/master
Add FormatEnumsAsIntegers support for Json Format. Scale JsonFormatter.Settings for multi options.
2017-03-27 11:05:38 -07:00
Jie Luo
689e4bf5f4 Add FormatEnumAsInt support for Json Format. And scale JsonFormatter.Settings to multiple options. 2017-03-24 12:05:52 -07:00
Paul Yang
6b27c1f981 Add file option php_class_prefix (#2849)
This option will be prepended to generated classes of all messages in
the containing file.
2017-03-17 11:08:06 -07:00
Jie Luo
606cb7ed2c There might be duplicated enum values when allow_alias is true. Add PreferredAlias into OriginalNameAttribute to remove the duplication (#2727) 2017-02-28 10:51:19 -08:00
John Brock
17174b54dd Updating README
- Adding more detail on running tests
- Adding info about the status of .NET 3.5 support and how to enable .NET 3.5
2017-02-23 10:51:52 +00:00
John Brock
f83d129555 Upgrading test-related libraries
NUnit 3.4.0 —> 3.6.0
dotnet-test-nunit 3.4.0-alpha-2 —> 3.4.0-beta-3
2017-02-23 10:51:52 +00:00
John Brock
c9b2c8f327 Fixes for .NET 3.5 compatibility
* Changing DOTNET35 framework symbols in preprocessor directives to the default built-in value of NET35.
* Adding extension method StreamExtension.CopyTo for .NET 3.5 because it didn’t exist until .NET 4, and adding associated unit tests.
2017-02-23 10:51:52 +00:00
Jie Luo
3f6f73b796 Merge pull request #2701 from anandolee/master
Add csharp compatibility tests against v3.0.0
2017-02-13 10:54:34 -08:00
Jie Luo
7288689d8c Add csharp compatibility tests against v3.0.0 and run on Travis. 2017-02-10 13:40:16 -08:00
Jie Luo
9f09d1804a Add proto and test files for csharp compatibility tests against v3.0.0.
All the files are copied from 3.0.0 (JosnFormaterTest was deleted)
2017-02-09 16:43:18 -08:00
Jon Skeet
bd29f86804 Fix CopyTo argument validation
Fixes #2669.
2017-02-06 18:24:19 +00:00
Paul Yang
7f3e237071 Merge 3.2.x branch into master (#2648)
* Down-integrate internal changes to github.

* Update conformance test failure list.

* Explicitly import used class in nano test to avoid random test fail.

* Update _GNUC_VER to use the correct implementation of atomic operation
on Mac.

* maps_test.js: check whether Symbol is defined before using it (#2524)

Symbol is not yet available on older versions of Node.js and so this
test fails with them. This change just directly checks whether Symbol is
available before we try to use it.

* Added well_known_types_embed.cc to CLEANFILES so that it gets cleaned up

* Updated Makefile.am to fix out-of-tree builds

* Added Bazel genrule for generating well_known_types_embed.cc

In pull request #2517 I made this change for the CMake and autotools
builds but forgot to do it for the Bazel build.

* Update _GNUC_VER to use the correct implementation of atomic operation on Mac.

* Add new js file in extra dist.

* Bump version number to 3.2.0

* Fixed issue with autoloading - Invalid paths (#2538)

* PHP fix int64 decoding (#2516)

* fix int64 decoding

* fix int64 decoding + tests

* Fix int64 decoding on 32-bit machines.

* Fix warning in compiler/js/embed.cc

embed.cc: In function ‘std::string CEscape(const string&)’:
embed.cc:51:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < str.size(); ++i) {
                                ^

* Fix include in auto-generated well_known_types_embed.cc

Restore include style fix (e3da722) that has been trampled by
auto-generation of well_known_types_embed.cc

* Fixed cross compilations with the Autotools build

Pull request #2517 caused cross compilations to start failing, because
the js_embed binary was being built to run on the target platform
instead of on the build machine. This change updates the Autotools build
to use the AX_PROG_CXX_FOR_BUILD macro to find a suitable compiler for
the build machine and always use that when building js_embed.

* Minor fix for autocreated object repeated fields and maps.

- If setting/clearing a repeated field/map that was objects, check the class
  before checking the autocreator.
- Just to be paranoid, don’t mutate within copy/mutableCopy for the autocreated
  classes to ensure there is less chance of issues if someone does something
  really crazy threading wise.
- Some more tests for the internal AutocreatedArray/AutocreatedDictionary
  classes to ensure things are working as expected.
- Add Xcode 8.2 to the full_mac_build.sh supported list.

* Fix generation of extending nested messages in JavaScript (#2439)

* Fix generation of extending nested messages in JavaScript

* Added missing test8.proto to build

* Fix generated code when there is no namespace but there is enum definition.

* Decoding unknown field should succeed.

* Add embed.cc in src/Makefile.am to fix dist check.

* Fixed "make distcheck" for the Autotools build

To make the test pass I needed to fix out-of-tree builds and update
EXTRA_DIST and CLEANFILES.

* Remove redundent embed.cc from src/Makefile.am

* Update version number to 3.2.0-rc.1 (#2578)

* Change protoc-artifacts version to 3.2.0-rc.1

* Update version number to 3.2.0rc2

* Update change logs for 3.2.0 release.

* Update php README

* Update upb, fixes some bugs (including a hash table problem). (#2611)

* Update upb, fixes some bugs (including a hash table problem).

* Ruby: added a test for the previous hash table corruption.

Verified that this triggers the bug in the currently released
version.

* Ruby: bugfix for SEGV.

* Ruby: removed old code for dup'ing defs.

* Reverting deployment target to 7.0 (#2618)

The Protobuf library doesn’t require the 7.1 deployment target so
reverting it back to 7.0

* Fix typo that breaks builds on big-endian (#2632)

* Bump version number to 3.2.0
2017-01-31 09:17:32 -08:00
Jon Skeet
afc59ab55a C#: Implement IReadOnlyList<T> in RepeatedField<T>
We explicitly don't do this when targeting .NET 3.5, where the
interface doesn't exist.

No implementation is required, as we're already implementing
everything we need for IList<T>.
2017-01-30 18:58:56 +00:00
Jie Luo
ccb76fff44 Add Oneof custom options test 2017-01-27 11:52:32 -08:00
Jon Skeet
047575f20c Support custom options in C#
This consists of:
- Changing the codegen for the fixed set of options protos, to parse unknown fields instead of skipping them
- Add a new CustomOptions type in the C# support library
- Expose CustomOptions properties from the immutable proto wrappers in the support library

Only single-value options are currently supported, and fetching options values requires getting the type right
and knowing the field number. Both of these can be addressed at a later time.

Fixes #2143, at least as a first pass.
2017-01-19 06:46:04 +00:00
Jon Skeet
fb71df9f0b Add ByteString.FromStream and ByteString.FromStreamAsync in C#
Fixes #2088.

We now have separate tests for netcoreapp and net45 to test the two branches here.
(netstandard10 doesn't have MemoryStream.GetBuffer)

Although most of this library doesn't have any async functionality,
this feels like a natural place to locally add it.
2017-01-10 13:05:27 +00:00
Jon Skeet
e76d91a9d1 Add global.json file to pick dotnet core SDK version. 2017-01-10 13:05:27 +00:00
Jon Skeet
b18bc9b944 Give C# ByteString a sensible GetHashCode implementation.
Fixes #2511.
2016-12-16 12:04:40 +00:00
Jan Tattermusch
9d709f446f Merge pull request #2487 from jtattermusch/csharp_leading_whitespace
remove leading whitespace in C# xml comments
2016-12-13 13:42:23 +01:00
Jan Tattermusch
fda9049ead remove leading whitespace in C# xml comments 2016-12-12 12:41:26 +01:00
Michael Darakananda
bb77cbf05a update descriptor.proto's go_package
This change has already been made in google's repo.
Replicating the change here to unblock work on genproto.
2016-12-07 18:15:17 +11:00
Joshua Haberman
f1ce60e7b4 Factored Conformance and Benchmark test messages into shared test schema. (#1971)
* Factored Conformance test messages into shared test schema.

* Updated benchmarks to use new proto3 message locations.

* Fixed include path.

* Conformance: fixed include of Python test messages.

* Make maven in Rakefile use --batch-mode.

* Revert changes to benchmarks.

On second thought I think a separate schema for
CPU benchmarking makes sense.

* Try regenerating C# protos for new test protos.

* Removed benchmark messages from test proto.

* Added Jon Skeet's fixes for C#.

* Removed duplicate/old test messages C# file.

* C# fixes for test schema move.

* Fixed C# to use the correct TestAllTypes message.

* Fixes for Objective C test schema move.

* Added missing EXTRA_DIST file.
2016-12-03 11:51:25 -05:00
Thomas Van Lenten
f813bd9f8f Add a swift_prefix file option.
Swift generators should default to CamelCasing the proto package and prefixing
symbols with that, but this option allows developers to override that behavior
with something custom if they desire.

Fixes https://github.com/google/protobuf/issues/1833
2016-11-30 13:48:16 -05:00
Adam Cozzette
db35fe735a Add a "u" suffix to tag numbers in generated code
This seems to be necessary to prevent warnings in some compiler
configurations, particularly for tag numbers that are too large to fit
in a signed 32-bit int.
2016-11-22 16:23:55 -08:00
Julien Brianceau
3c0e0ce2b0 Fix csharp/src/Google.Protobuf.Test/project.json
This change fixes the following Chromium presubmit error:

  third_party/protobuf/csharp/src/Google.Protobuf.Test/project.json could
  not be parsed: Expecting property name: line 25 column 3 (char 482)
2016-11-14 22:32:15 +01:00
Msp
089aaa996a Fix message for InvalidProtocolBufferException 2016-11-04 23:54:34 +05:30
Jon Skeet
50a37e0135 Change JSON field name formatting
This affects cases with leading capital letters.

This breaks compatibility with previous C# releases, but
fixes compatibility with other implementations.

See #2278 for details.
2016-11-03 18:05:59 +00:00
Bo Yang
89db7ce02b Add script to build Google.Protobuf.Tools for csharp. 2016-10-10 11:44:21 -07:00
Bo Yang
e62d1f13f2 Add back removed descriptor field. 2016-10-10 11:44:21 -07:00
Feng Xiao
f933d10fbe Update version number.
[skip ci]

Change-Id: I1ba6f6372a08b5796570851336e1a548602f60da
2016-10-10 11:44:21 -07:00