aboutsummaryrefslogtreecommitdiffstats
path: root/Android.mk
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2015-02-11 13:12:14 -0800
committerJeff Davidson <jpd@google.com>2015-02-19 19:55:26 +0000
commit30d873bd66f50a6021de5d44d7ee5b8a809b0524 (patch)
treec4cec97120f5b387aa9ea6910ff1e839725ccfb8 /Android.mk
parenteb5ae9e258a8fc953e6cf0b3a0dd04a112a05a3c (diff)
downloadexternal_protobuf-30d873bd66f50a6021de5d44d7ee5b8a809b0524.zip
external_protobuf-30d873bd66f50a6021de5d44d7ee5b8a809b0524.tar.gz
external_protobuf-30d873bd66f50a6021de5d44d7ee5b8a809b0524.tar.bz2
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
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index fcf9a21..5dc957c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -462,6 +462,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE := android-nano-test-parcelable
LOCAL_MODULE_TAGS := tests
LOCAL_SDK_VERSION := current
+# Only needed at compile-time.
+LOCAL_JAVA_LIBRARIES := android-support-annotations
LOCAL_PROTOC_OPTIMIZE_TYPE := nano
@@ -470,7 +472,8 @@ LOCAL_SRC_FILES := src/google/protobuf/unittest_simple_nano.proto
LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
- parcelable_messages = true
+ parcelable_messages = true, \
+ generate_intdefs = true
include $(BUILD_STATIC_JAVA_LIBRARY)
@@ -480,6 +483,8 @@ include $(CLEAR_VARS)
LOCAL_MODULE := android-nano-test-parcelable-extendable
LOCAL_MODULE_TAGS := tests
LOCAL_SDK_VERSION := current
+# Only needed at compile-time.
+LOCAL_JAVA_LIBRARIES := android-support-annotations
LOCAL_PROTOC_OPTIMIZE_TYPE := nano
@@ -489,6 +494,7 @@ LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/src
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := \
parcelable_messages = true, \
+ generate_intdefs = true, \
store_unknown_fields = true
include $(BUILD_STATIC_JAVA_LIBRARY)