Commit Graph

72 Commits

Author SHA1 Message Date
Chris Smith
d98e9c4d0e Allow NaN/+inf/-inf defaults in micro/nano.
Adds support for default values of NaN, infinity and negative
infinity for floats and doubles in both the nano and micro
java compiler.

Change-Id: Ibc43e5ebb073e51d9a8181f3aa23b72e10015dca
2013-07-23 19:13:36 +01:00
Ulas Kirazci
c01060c8ca Merge "Add contribution instructions for nano." 2013-07-19 22:24:14 +00:00
Ulas Kirazci
39799d09f1 Add contribution instructions for nano.
Change-Id: Ie110d182a84258ab5bb3ba1f67c6ada6be476c7e
2013-07-19 11:57:35 -07:00
Ulas Kirazci
86595020a8 Merge "Update nano to serialize java keywords properly." 2013-07-19 18:54:24 +00:00
Tom Chao
d4bb971d18 Update nano to serialize java keywords properly.
Change-Id: I7407d0fab609c336ecd73499e725aed0dd50f555
2013-07-19 09:30:56 -07:00
Ulas Kirazci
b8f5dad1c7 Merge "Make it possible to use MessageNano.mergeFrom without casting." 2013-07-09 17:23:52 +00:00
Brian Duff
a9c4e082e0 Make it possible to use MessageNano.mergeFrom without casting.
You can now do:

  MyMessage foo = MessageNano.mergeFrom(new MyMessage(), bytes);

without having to cast the message returned from mergeFrom.

Change-Id: Ibb2ad327f75855d45352ad304c7f054f20dd29c9
2013-07-08 22:29:51 -07:00
Wink Saville
499f47ffdb Merge "Nano support for extensions and unknown fields." 2013-06-25 16:53:07 +00:00
Brian Duff
5659cca8c8 Nano support for extensions and unknown fields.
You can use the processor option store_unknown_fields to switch
this support on:

  aprotoc --javanano_out=store_unknown_fields=true:/tmp/out

A separate option for extensions isn't required. Support
for unknown fields must be turned on to allow storing and
retrieving extensions, because they are just stored as
unknown fields. If unknown fields are switched on, extension
related code will be generated when a proto message includes
an extension range, or an extension is encountered.

By default, store_unknown_fields is false. No additional
code is generated, and the generator will error out if protos
contain extension ranges or extensions.

Change-Id: I1e034c9e8f3305612953f72438189a7da6ed2167
2013-06-24 16:02:12 -07:00
Wink Saville
661f87ceb8 Merge "Fix enum field references with java_multiple_files." 2013-06-07 21:45:14 +00:00
Brian Duff
a220fe61e1 Fix enum field references with java_multiple_files.
When the java_multiple_files option is on, enums are placed in java
class files based on the name of the original enum type. This fixes
field references to such enum values to point to the correct class
name when setting the default.

Change-Id: I51a2e251c0d0ab1e45a182ba849d314232a74bac
2013-06-07 14:00:05 -07:00
Wink Saville
63d4b5fd57 Merge "Add toString() method to MessageNano." 2013-06-06 23:30:07 +00:00
Wink Saville
b0874cc632 Merge "Fix javanano compiler generating uncompileable java code. This happened for enums when java_multiple_files=true." 2013-06-06 01:29:31 +00:00
Brian Duff
296787577a Fix javanano compiler generating uncompileable java code. This happened
for enums when java_multiple_files=true.

Change-Id: Ia6fe1a51c6a46eb9a2f29527829794076b165cb7
Signed-off-by: Brian Duff <bduff@google.com>
2013-06-05 15:38:33 -07:00
Andrew Flynn
a16121550b Add toString() method to MessageNano.
- All of the real work for printing the proto is actually done in
  MessageNanoPrinter.
- Uses reflection to find proto-defined fields and prints those.
- Prints all fields, even defaults and nulls.
- Also added a simple test to make sure it handles all proto types well.
  Tried not to make the test too brittle (but hey it's testing a toString()
  so how flexible can it be)

Change-Id: I3e360ef8b0561041e010c1f3445ec45ecdcd2559
2013-06-04 13:26:58 -07:00
Wink Saville
bb9b49029e Merge "Fix typos in protobuf readme." 2013-04-29 23:33:04 +00:00
Matt Thrailkill
adf95183f6 Fix typos in protobuf readme.
Change-Id: Ifa3c8674482ae9575df459a3e76e9f8b4a9296b5
Signed-off-by: Matt Thrailkill <mthrailkill@google.com>
2013-04-26 16:08:53 -07:00
Ficus Kirkpatrick
4349e11df9 Merge "Don't use Arrays.copyOf in generated code." 2013-04-09 00:19:09 +00:00
Ficus Kirkpatrick
314a302933 Don't use Arrays.copyOf in generated code.
It didn't appear until API 9 and is thus incompatible with Froyo.
Instead, allocate a new array and System.arraycopy inline.

Change-Id: I2e1cd07a4a762ef8edd5ec06ceaa1d38b302823d
2013-04-08 15:47:56 -07:00
Wink Saville
d4bb580f1b Merge "Prevent conflicts between local and proto variable names." 2013-04-04 12:55:13 +00:00
Ulas Kirazci
3234cee5ba Prevent conflicts between local and proto variable names.
Prefix access to proto variable names with "this.". Also remove unused
GenerateMergingCode.

Change-Id: I5f07d3252fc385c4174d9165b64785b40f676e17
2013-04-03 15:53:19 -07:00
Wink Saville
64a842122c Merge "Nano protobufs." 2013-04-01 23:51:39 +00:00
Ulas Kirazci
2337023fd9 Nano protobufs.
Like micro protobufs except:

- No setter/getter/hazzer functions.
- Has state is not available. Outputs all fields != their default.
- CodedInputStream can only take byte[] (not InputStream).
- Repeated fields are in arrays, not ArrayList or Vector.
- Unset messages/groups are null, not "defaultInstance()".
- Required fields are always serialized.

To use:

- Link libprotobuf-java-2.3.0-nano runtime.
- Use LOCAL_PROTOC_OPTIMIZE_TYPE := nano

Change-Id: I7429015b3c5f7f38b7be01eb2d4927f7a9999c80
2013-04-01 14:55:45 -07:00
Ying Wang
c991c16e92 Build against the NDK for x86 and mips too.
Change-Id: I68963dc1c274c3dcf1038d4e21dc418f9554b78f
2012-12-14 18:19:15 -08:00
Ying Wang
b74eb3fc65 Retire LOCAL_NDK_VERSION.
Bug: 6932421
Change-Id: Ieaad80daf4e6a4a7f058dd242f37a144e8ee9e76
2012-08-14 12:02:51 -07:00
Ying Wang
4747b03ac1 Build the target protobuf libraries against the NDK
This change unbundled the protobuf target libraries, so they can be used
in unbundled branches.

Change-Id: Ic4948f27395b2c2b81ea120d9e2353ba9aad02a8
2012-06-15 14:37:32 -07:00
Jeff Brown
17892bccbb Remove the simulator target from all makefiles.
Bug: 5010576

Change-Id: I9a5e66066482aa0007f221bb866ac57f4eb1b70c
2011-07-11 22:12:04 -07:00
Ying Wang
d4bdc4c78a am 7cc5f59e: Unbundle protobuffer target libraries.
* commit '7cc5f59ec79718040bb1efd8be2ed12af2de5e1a':
  Unbundle protobuffer target libraries.
2011-02-07 18:37:09 -08:00
Ying Wang
3b3e5e580c Unbundle protobuffer target libraries.
Change-Id: I3047d2cd10828844562fa57ae3b619fe919c6113
2011-02-07 18:23:25 -08:00
Ying Wang
ddf74061de Unbundle protobuffer target libraries.
Change-Id: I535f93389b3b13578c9602dce3d38f1ca256e807
2011-01-26 13:37:44 -08:00
Wink Saville
4e79aac882 Rename protoc to aprotoc.
With gLucid protoc is installed in the base system, by renaming
our version there will be no confusion about which compiler is
being used.

Change-Id: I975e29e4444af9467c9b9600d5a2e7027f4046ae
2010-11-05 11:28:46 -07:00
Iain Merrick
f5bc288bb2 Build the protocol buffer compiler 'protoc'.
We need this to generate code for .proto files that have
been added to external/chromium (see change I6960c18d).

Change-Id: Ic7a78273ee4f066680039d2f724e658a84869621
2010-11-02 14:44:37 +00:00
Wink Saville
69004c5194 am 3574de1c: Remove vestigial references to StringUtf8Micro.
Merge commit '3574de1ca8301e1e13d1c89f2e2a902499d6bae9' into gingerbread-plus-aosp

* commit '3574de1ca8301e1e13d1c89f2e2a902499d6bae9':
  Remove vestigial references to StringUtf8Micro.
2010-10-07 13:56:12 -07:00
Wink Saville
b164b01203 Remove vestigial references to StringUtf8Micro.
Change-Id: Ica75231b03de4768c671bf046b92bd7630ecd5c8
2010-10-06 10:00:08 -07:00
Jean-Baptiste Queru
ee613fac56 merge from gingerbread
Change-Id: Id43a6262c3f5cffc37db77748f129acb9c841823
2010-10-05 15:05:17 -07:00
Jean-Baptiste Queru
6ebe2303fd Make these modules optional.
This allows compiling this code in Gingerbread.

Bug: 3064326

Change-Id: Idab78a5a31a3c2fc35bcdb773aaecf1e4fb70bcb
2010-10-05 10:26:34 -07:00
Omari Stephens
aa6776432a Make protobuf usable by host-side java apps
Change-Id: Ic214bfb361eb2167d301b55a34b209a84a6d4a08
2010-09-30 18:50:26 -07:00
Wink Saville
7d0a2a3c88 Add libprotobuf-cpp-2.3.0-full.
Add full c++ version of libprotobuf as a static library.

Change-Id: I153bc913ff51e6a904284b733cac000497e1caac
2010-06-28 15:05:24 -07:00
Wink Saville
00302c1d16 Changed speed optimization for strings.
Removed use of StringUtf8Micro and instead use an extra byte array
instance variable directly in the class. This allows the list returned
for repeated strings to be a String instead of a StringUtf8Micro
making the class compatible with existing code.

Removed PerfTimer.java which isn't used.

Change-Id: Ie6acfb40f98f59a48c1a795d86f715078f9611f5
2010-06-07 17:04:13 -07:00
Wink Saville
e9da248ad9 Add libprotobuf-java-2.3.0-lite.
Also, have all the libraries follow the same naming convention so
rename com.google.protobuf.micro library to libprotobuf-java-2.3.0-micro.

Change-Id: I7c2a7d883a17f9a6d084ce4cac9601e344e416bf
2010-06-04 17:44:37 -07:00
Kenny Root
c0333631e1 Skip stlport for simulator
The host's stl library conflicts with stlport, so we need to exclude
stlport from inclusion in the build if we're targeting the simulator.

Change-Id: Ib4da6140f4b8abb271d8e67636ccec2a796c8c5a
2010-06-04 09:39:02 -07:00
Wink Saville
c778cad86d Merge "Add libprotobuf-cpp-2.3.0-lite" 2010-06-03 15:55:02 -07:00
Wink Saville
acf8ef12d0 Add libprotobuf-cpp-2.3.0-lite
Added android/config.h which will be used to configure
android builds of libraries. Currently I've undef HAVE_HASH_MAP
and HAVE_HASH_SET as the versions in stlport generated compile
errors.

Updated .gitignore to be more selective on what it ignores so
android/config.h wouldn't be ignored.

Change-Id: I53f3636121db2c6017491a37998b816aaf0cab5d
2010-06-03 15:33:07 -07:00
Wink Saville
ce7a2b0149 Add support for Java micro protobuf's to protobuf-2.3.0.
See README.android for additional information.

Change-Id: I6693e405c0d651eacacd3227a876129865dd0d3c
2010-05-29 13:13:38 -07:00
Wink Saville
5ab6e29684 Add protobuf 2.3.0 sources
This is the contents of protobuf-2.3.0.tar.bz2 from
http://code.google.com/p/protobuf/downloads/list.

Change-Id: Idfde09ce7ef5ac027b07ee83f2674fbbed5c30b2
2010-05-29 13:00:38 -07:00
Wink Saville
e5566f8673 Add support for Java micro protobuf's to protobuf-2.2.0a.
See README.android for additional information.

Change-Id: I9c5ef2eec484cc87e32841f39060f8f27b8e8472
2010-05-28 11:49:52 -07:00
Wink Saville
3df2fda0e4 Add protobuf 2.2.0a sources
This is the contents of protobuf-2.2.0a.tar.bz2 from
http://code.google.com/p/protobuf/downloads/list and
is the base code for the javamicro code generator.

Change-Id: Ie9a0440a824d615086445b6636944484b3155afa
2010-05-27 16:25:37 -07:00
Wink Saville
f9e5cc7058 The Android specific files prior to adding protobuf 2.2.0a sources.
Change-Id: Ib1009c088a3815c9152385e2b764a2c7cd28317e
2010-05-27 15:44:42 -07:00
The Android Open Source Project
3ac755cb94 am 96ccdc22: reconcile main tree with open-source eclair
Merge commit '96ccdc223b71f9e356d10ed3199007567996e062'

* commit '96ccdc223b71f9e356d10ed3199007567996e062':
  android-2.1_r1 snapshot
2010-02-05 14:09:54 -08:00
The Android Open Source Project
b9ebfe977b reconcile main tree with open-source eclair 2010-02-05 08:09:36 -08:00