aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
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.