From 30d873bd66f50a6021de5d44d7ee5b8a809b0524 Mon Sep 17 00:00:00 2001 From: Jeff Davidson Date: Wed, 11 Feb 2015 13:12:14 -0800 Subject: 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 --- Android.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Android.mk') 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) -- cgit v1.1