Commit Graph

2165 Commits

Author SHA1 Message Date
Josh Haberman
1f34eb6e7a Merge Gerrit master into GitHub master.
Adds conformance test support for Java.
2015-05-06 13:16:57 -07:00
Jon Skeet
7879f82ddc Add C# namespace to .proto files (e.g. descriptors, unit tests) 2015-05-06 19:07:14 +01:00
Thomas Van Lenten
30650d81d9 Alpha 1 drop of Google's Objective C plugin and runtime support for protobufs. 2015-05-06 13:19:14 -04:00
Andre Eisenbach
15bff99de6 Handle 0-length byte buffers in micro and nano protobufs
Change-Id: I845ee1ab1005d25c8d77a8c2ed801c0f7b7c847b
2015-05-04 17:58:26 -07:00
Yohei Yukawa
cf9f603e8d Undef GOOGLE_PROTOBUF_MISSING_HASH after it is used.
This is a follow up CL for df184fba00
(Id937e25bbb35968ee76c92bd4a8ce6247408c443), which added
  #undef GOOGLE_PROTOBUF_MISSING_HASH
where GOOGLE_PROTOBUF_MISSING_HASH macro is never defined.

With this CL, GOOGLE_PROTOBUF_MISSING_HASH macro will be cleaned up
after it is used.
2015-05-04 01:25:52 -07:00
Chris Fallin
16a283f794 Merge pull request #334 from skippy/allow-msg-to-accept-nil
ruby: allow a message field to be unset
2015-05-02 19:02:08 -07:00
Chris Fallin
dcf1213683 Merge pull request #332 from skippy/nil-out-of-bounds
ruby: return nil for out of bounds
2015-05-02 19:00:44 -07:00
Adam Greene
64678265c5 allow a message field to be unset 2015-05-02 13:48:23 -07:00
Adam Greene
d55733c76e return nil if array index indicie is out of bounds
ruby arrays don't throw an exception; they return nil.  Lets do the
same!

this fix also includes the ability to use negative array indicies
2015-05-01 22:50:57 -07:00
Jie Luo
e0afc0028f Merge pull request #330 from anandolee/csharp
Remove ClsCompliant declarations from C# code (fix #318)
2015-05-01 15:04:45 -07:00
Chris Fallin
4b2a6328bd Merge pull request #328 from skippy/add-size
ruby: Add size to RepeatField
2015-05-01 14:11:13 -07:00
Jie Luo
d9e3063eb0 Remove ClsCompliant declarations from C# code 2015-05-01 14:08:23 -07:00
Adam Greene
c70b6058ea add size alias for length
starting to make `RepeatedField` quack like an array

additional changes:
* make sure gemspec gets all ruby code files
* add homepage in gem spec removes one of the warnings, and the gem spec authors are pushing
everyone to include a homepage in the gem
* remove excess whitespace in test suite to bring formatting inline with the rest of the file
2015-05-01 11:48:04 -07:00
Jie Luo
447de3ad6e Merge pull request #321 from anandolee/csharp
Field Presence for Protocol Buffer C# Proto3
2015-05-01 10:50:22 -07:00
Jie Luo
ea48104cdd fix comments 2015-05-01 10:35:19 -07:00
Chris Fallin
c881159557 Merge pull request #327 from skippy/build-cleanup
ruby: build cleanups
2015-05-01 10:25:18 -07:00
Jie Luo
41c175e711 Change field_presence_test.proto 2015-05-01 10:12:54 -07:00
Adam Greene
761cfa08e6 build cleanups
* update docs to simplify build steps
* Gemfile.lock seemed to have an older version specified
* do not check in the pkg dir
2015-05-01 08:48:56 -07:00
Jie Luo
3d4b761998 fix comments 2015-04-30 18:36:17 -07:00
Jie Luo
6e1ec5f6ea fix commends from Jon Skeet 2015-04-30 18:19:50 -07:00
Jie Luo
24ae5105f3 Merge branch 'csharp' of git://github.com/google/protobuf into google-csharp 2015-04-30 11:23:09 -07:00
Jisi Liu
614063ab85 Merge pull request #325 from TeBoring/master
Generate pbconfig.h in generate_descriptor_proto.sh
2015-04-30 10:53:04 -07:00
Bo Yang
efa666cf0a Generate pbconfig.h in generate_descriptor_proto.sh 2015-04-30 10:29:47 -07:00
Jon Skeet
0884b77975 Merge pull request #324 from jskeet/csharp
Change to using xUnit for all unit tests, and fetch that via NuGet.
2015-04-30 14:51:42 +01:00
Jon Skeet
c56475088d Change to using xUnit for all unit tests, and fetch that via NuGet.
This includes fetching the VS unit test runner package, so that tests can be run from Visual Studio's Test Explorer.
2015-04-30 11:29:35 +01:00
Jon Skeet
151018e888 Merge pull request #319 from jskeet/csharp_pcl
Convert C# projects to Portable Class Libraries
2015-04-30 10:35:27 +01:00
Jie Luo
954bc83413 Merge branch 'csharp' of git://github.com/google/protobuf into google-csharp 2015-04-29 15:55:11 -07:00
Jie Luo
4af18b8711 rename FieldPResenceTest.cs file 2015-04-29 14:20:23 -07:00
Jon Skeet
ce97e68682 Convert both the full and lite runtimes (and json/xml serialization assemblies) to be Portable Class Libraries.
All referring projects are now .NET 4 client rather than .NET 3.5.
This commit also fixes up the ProtoBench app, which I'd neglected in previous commits. (Disentangling the two sets of changes would be time-consuming.)
2015-04-29 21:15:16 +01:00
Jon Skeet
a449f66bdb Merge pull request #317 from jskeet/csharp
Tidying up the C# runtime project
2015-04-29 20:59:44 +01:00
Jie Luo
d1f5acaafb Change the package for field_presence_test.proto 2015-04-29 11:49:14 -07:00
Jie Luo
c5c9c6a7e0 field presence Reflection and tests 2015-04-29 11:33:07 -07:00
Jisi Liu
0e122ce8c5 Merge pull request #315 from brianduff/sync_from_aosp
Sync nanoproto from AOSP
2015-04-29 10:44:35 -07:00
Feng Xiao
5a9863b584 Merge pull request #303 from xfxyjwf/wkt
Include well-known type protos in "make install".
2015-04-29 10:41:35 -07:00
Jon Skeet
0e916d09a3 Removing more C# project files. 2015-04-29 12:22:35 +01:00
Jon Skeet
f015b860b7 Remove CLS compliance from runtime code.
We need to remove it from the generator too; I'll raise a github issue for that.
2015-04-29 12:21:54 +01:00
Jon Skeet
5e0189ab94 Update C# solution and AddressBook project.
Move to a single solution file containing all of the C# projects, but no other solution folders - it's easier to edit those files outside VS than keep adding and removing them from the project.
The AddressBook protos have been regenerated (with a change to the example proto which I haven't included in this change - I'll wait for us to decide exactly what we're doing with namespaces before changing protos outside the csharp directory.

Note that now we've got Addressbook.cs which contains AddressBook and Addressbook classes. It's bad enough that we've got a class called AddressBook within a namespace of AddressBook (hard to get away from) but having things vary just by case is nasty.
This is more evidence that an option for renaming the file and descriptor class would be welcome. (A single option can probably handle both.)
2015-04-29 10:10:20 +01:00
Jon Skeet
f651f73a3c Remove support for Serializable.
This could potentially be added back in later, but its use is limited and it's a pain in terms of support in PCL environments.
One use that has been highlighted is passing objects between AppDomains; we'd recommend passing a byte array explicitly and reparsing on the other side.
2015-04-29 09:18:19 +01:00
Jon Skeet
cc058e1118 Remove RPC support.
It is expected that third parties will generate service/RPC code themselves - see gRPC as an example.
2015-04-29 08:55:07 +01:00
Jon Skeet
e8310aa259 Remove a bunch of files which are no longer relevant:
1) Project files for different configurations - we're going to look at all this again, ideally to just have a single PCL-compatible build
2) ProtoGen - the C++ generator is now the only one we care about
3) Proto files - these are mostly duplicates (or older versions) of the ones in the common directories
2015-04-29 06:55:51 +01:00
Jie Luo
8bae6c09bc Merge pull request #1 from google/csharp
Csharp update
2015-04-28 16:26:19 -07:00
Jie Luo
32ead755d1 Merge pull request #313 from jskeet/csharp
First steps to making the C# runtime work with new codegen
2015-04-28 14:23:18 -07:00
Jeff Davidson
9d546c85bd Generate a CREATOR for each Parcelable message.
This is less ideal from a dex count perspective because it requires a
new variable for each message, and because most apps have proguard
rules that will ensure that CREATOR classes are retained.

However, it is required to be able to use nano protos inside of AIDL
files, as the autogenerated AIDL code fails to compile otherwise. This
is a substantial benefit as it allows for backwards-compatible
parameters and return types in AIDL methods along the lines of
safeparcel.

Bug: 19084705
Change-Id: I66a2c0424b96cf8ff6b631b186cc4f9407dfc1f4
2015-04-28 13:12:37 -07:00
Charles Munger
6732dd7e58 Throw OutOfSpaceException instead of IllegalArgumentException.
When a MessageNano containing a String is serialized into a buffer that
is too small to contain it, and the buffer's boundary happens to be
where the string field's length delimiting varint is serialized,
and the string's length and 3*length have the same length when
encoded as a varint, an IllegalArgumentException is thrown rather than
an OutOfSpaceException.

Github issue: https://github.com/google/protobuf/issues/292

Change-Id: If478d68cf15bfd0662252d008e42b2bf1ff1c75e
2015-04-28 13:10:49 -07:00
Brian Duff
a69b461e1e Inline unknownFieldData{Equals,HashCode} to generated code.
It turns out dex (apparently) was inlining these protected final
methods from ExtendableMessageNano into every message class. Removing
these methods from the base class and inlining their code reduces
the method count by 2 methods / message when the store_unknown_fields
option is on.

Change-Id: I0aa09f2016d39939c4c8b8219601793b8fab301f
2015-04-28 13:02:33 -07:00
Brian Duff
dac7e02d2b Expose generate_clear as an option.
I wasn't able to get the clear() method to inline into the
constructor when optimizations are on in proguard. As a result,
every message has an extra superfluous kept method assuming the
app never uses clear() directly.

There are a couple of instances where setting this option false is
necessary in order to get code dexing successfully without hitting
the method limit, e.g. https://goto.google.com/tltzq

In this example, I tried turning on the method/inlining/unique and
method/inlining/short optimizations before resorting to adding the
generate_clear option, but the method count did not decrease. The
clear() methods were contributing over a thousand extra methods.

Change-Id: If6a9651d6a59cdf70b1040d8248779710ac73105
2015-04-28 13:01:48 -07:00
Jeff Davidson
ec19be2f3c Generate @IntDef annotations for nanoproto enums.
@IntDef is a support library annotation which allows build tools to
determine the valid set of values for a given integer field when that
field is intended to be restricted like an enum. This avoids the
overhead of enums while still allowing for compile-time type checking
in most circumstances.

Change-Id: Iee02e0b49a8e069f6456572f538e0a0d301fdfd5
2015-04-28 13:01:12 -07:00
Shai Barack
41f0294cd6 Add reset() and position() to CodedOutputByteBufferNano.
Change-Id: Ie2a9e36276ac35e10b3f8d379b5742d50a0374e9
2015-04-28 12:47:42 -07:00
Kweku Adams
2712c42136 DO NOT MERGE Overloading createMessageTyped to accept a tag as an integer.
When building, some instances expect createMessageTyped to have the signature
(int, Class, long), while others expect (int, Class, int). Simply having
the former signature meant that builds expecting the latter would fail.

This is a cherrypick of change b2a9d4321578139677c146ce37eba5e27e8f5c79
from master.

Change-Id: Ib02dbf66173510f4edea32c7b43e82c1a7a38aa2
2015-04-28 12:46:35 -07:00
Brian Duff
714dba3ab8 Exclude cachedSize when printing fields.
Change-Id: I85563b74237d38c1e447b7286f5f6e62d57e3d63
2015-04-28 12:44:08 -07:00