Skip to content

Commit 4332565

Browse files
ukirazcionoratoj
authored andcommitted
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
1 parent adeccdc commit 4332565

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+24355
-14873
lines changed

Android.mk

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ COMPILER_SRC_FILES := \
106106
src/google/protobuf/compiler/javamicro/javamicro_message.cc \
107107
src/google/protobuf/compiler/javamicro/javamicro_message_field.cc \
108108
src/google/protobuf/compiler/javamicro/javamicro_primitive_field.cc \
109+
src/google/protobuf/compiler/javanano/javanano_enum.cc \
110+
src/google/protobuf/compiler/javanano/javanano_enum_field.cc \
111+
src/google/protobuf/compiler/javanano/javanano_field.cc \
112+
src/google/protobuf/compiler/javanano/javanano_file.cc \
113+
src/google/protobuf/compiler/javanano/javanano_generator.cc \
114+
src/google/protobuf/compiler/javanano/javanano_helpers.cc \
115+
src/google/protobuf/compiler/javanano/javanano_message.cc \
116+
src/google/protobuf/compiler/javanano/javanano_message_field.cc \
117+
src/google/protobuf/compiler/javanano/javanano_primitive_field.cc \
109118
src/google/protobuf/compiler/python/python_generator.cc \
110119
src/google/protobuf/io/coded_stream.cc \
111120
src/google/protobuf/io/gzip_stream.cc \
@@ -121,6 +130,29 @@ COMPILER_SRC_FILES := \
121130
src/google/protobuf/stubs/strutil.cc \
122131
src/google/protobuf/stubs/substitute.cc
123132

133+
# Java nano library (for device-side users)
134+
# =======================================================
135+
include $(CLEAR_VARS)
136+
137+
LOCAL_MODULE := libprotobuf-java-2.3.0-nano
138+
LOCAL_MODULE_TAGS := optional
139+
LOCAL_SDK_VERSION := 8
140+
141+
LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
142+
143+
include $(BUILD_STATIC_JAVA_LIBRARY)
144+
145+
# Java nano library (for host-side users)
146+
# =======================================================
147+
include $(CLEAR_VARS)
148+
149+
LOCAL_MODULE := host-libprotobuf-java-2.3.0-nano
150+
LOCAL_MODULE_TAGS := optional
151+
152+
LOCAL_SRC_FILES := $(call all-java-files-under, java/src/main/java/com/google/protobuf/nano)
153+
154+
include $(BUILD_HOST_JAVA_LIBRARY)
155+
124156
# Java micro library (for device-side users)
125157
# =======================================================
126158
include $(CLEAR_VARS)

0 commit comments

Comments
 (0)