summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk17
-rw-r--r--java/src/main/java/com/google/protobuf/nano/Extension.java13
2 files changed, 30 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 5dc957c..9b8d0ef 100644
--- a/Android.mk
+++ b/Android.mk
@@ -66,6 +66,12 @@ JAVA_LITE_SRC_FILES := \
java/src/main/java/com/google/protobuf/SmallSortedMap.java \
java/src/main/java/com/google/protobuf/Utf8.java
+# This contains more source files than needed for the full version, but the
+# additional files should not create any conflict.
+JAVA_FULL_SRC_FILES := \
+ $(call all-java-files-under, java/src/main/java) \
+ src/google/protobuf/descriptor.proto
+
COMPILER_SRC_FILES := \
src/google/protobuf/descriptor.cc \
src/google/protobuf/descriptor.pb.cc \
@@ -230,6 +236,17 @@ LOCAL_SRC_FILES := $(JAVA_LITE_SRC_FILES)
include $(BUILD_HOST_JAVA_LIBRARY)
+# Java full library (for host-side users)
+# =======================================================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := host-libprotobuf-java-full
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(JAVA_FULL_SRC_FILES)
+
+include $(BUILD_HOST_JAVA_LIBRARY)
+
# C++ lite library
# =======================================================
include $(CLEAR_VARS)
diff --git a/java/src/main/java/com/google/protobuf/nano/Extension.java b/java/src/main/java/com/google/protobuf/nano/Extension.java
index b4d3eb0..6e2202e 100644
--- a/java/src/main/java/com/google/protobuf/nano/Extension.java
+++ b/java/src/main/java/com/google/protobuf/nano/Extension.java
@@ -74,6 +74,19 @@ public class Extension<M extends ExtendableMessageNano<M>, T> {
public static final int TYPE_SINT32 = 17;
public static final int TYPE_SINT64 = 18;
+ /**
+ * Creates an {@code Extension} of the given message type and tag number.
+ * Should be used by the generated code only.
+ *
+ * @param type {@link #TYPE_MESSAGE} or {@link #TYPE_GROUP}
+ * @deprecated use {@link #createMessageTyped(int, Class, long)} instead.
+ */
+ @Deprecated
+ public static <M extends ExtendableMessageNano<M>, T extends MessageNano>
+ Extension<M, T> createMessageTyped(int type, Class<T> clazz, int tag) {
+ return new Extension<M, T>(type, clazz, tag, false);
+ }
+
// Note: these create...() methods take a long for the tag parameter,
// because tags are represented as unsigned ints, and these values exist
// in generated code as long values. However, they can fit in 32-bits, so