summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorJeff Davidson <jpd@google.com>2015-02-19 19:56:07 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-19 19:56:07 +0000
commit72b0f4cfbb910909f953c52ba7d097a6b3904cbb (patch)
tree47cd1118e63974e416cb198ccd39110943b97dd7 /java
parent971aedc78cbafac28e521808710574803708202f (diff)
parent30d873bd66f50a6021de5d44d7ee5b8a809b0524 (diff)
downloadexternal_protobuf-72b0f4cfbb910909f953c52ba7d097a6b3904cbb.zip
external_protobuf-72b0f4cfbb910909f953c52ba7d097a6b3904cbb.tar.gz
external_protobuf-72b0f4cfbb910909f953c52ba7d097a6b3904cbb.tar.bz2
Merge "Generate @IntDef annotations for nanoproto enums."
Diffstat (limited to 'java')
-rw-r--r--java/README.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/java/README.txt b/java/README.txt
index 7081a84..b02e88b 100644
--- a/java/README.txt
+++ b/java/README.txt
@@ -593,6 +593,28 @@ ignore_services={true,false} (default: false)
parcelable_messages={true,false} (default: false)
Android-specific option to generate Parcelable messages.
+generate_intdefs={true,false} (default: false)
+ Android-specific option to generate @IntDef annotations for enums.
+
+ If turned on, an @IntDef annotation (a public @interface) will be
+ generated for each enum, and every integer parameter and return
+ value in the generated code meant for this enum will be annotated
+ with it. This interface is generated with the same name and at the
+ same place as the enum members' container interfaces described
+ above under enum_style=java, regardless of the enum_style option
+ used. When this is combined with enum_style=java, the interface
+ will be both the @IntDef annotation and the container of the enum
+ members; otherwise the interface has an empty body.
+
+ Your app must declare a compile-time dependency on the
+ android-support-annotations library.
+
+ For more information on how these @IntDef annotations help with
+ compile-time type safety, see:
+ https://sites.google.com/a/android.com/tools/tech-docs/support-annotations
+ and
+ https://developer.android.com/reference/android/support/annotation/IntDef.html
+
To use nano protobufs within the Android repo:
@@ -646,7 +668,7 @@ Please run the following steps to test:
- "make -j12 aprotoc libprotobuf-java-nano aprotoc-test-nano-params NanoAndroidTest" and
check for build errors.
- Plug in an Android device or start an emulator.
-- adb install -r out/target/product/generic/data/app/NanoAndroidTest.apk
+- adb install -r out/target/product/generic/data/app/NanoAndroidTest/NanoAndroidTest.apk
- Run:
"adb shell am instrument -w com.google.protobuf.nano.test/android.test.InstrumentationTestRunner"
and verify all tests pass.