android - documentation for annotation_processors (buck) -
related ticket parameters annotation processors disabled , undocumented
how use annotation_processors
, annotation_processor_deps
?
im using realm in sample android app , without annotations (for @realmclass , @realmmoudule) app crashes when built via buck (works if built via gradle).
in case stumbles on this, way use annotation processors buckbuild is:
- the
annotation_processors
immutable list of processor class. can identify package name used in meta-inf/services/javax.annotation.processing.processor file, example: realm processor - the
annotation_processor_deps
immutable list of rules (generallyprebuilt_jar
orandroid_prebuilt_aar
) holding annotation processor
a sample buck build file of project uses realm java
prebuilt_jar( name = 'realm', binary_jar = 'libs/realm-android-0.82.2.jar' ) android_library( name = 'main-lib', srcs = glob(['app/src/main/java/com/yourcompany/project/**/*.java']), deps = [ ':supportv4', ':all-jars', ':build-config', ':res', ], annotation_processors = ['io.realm.processor.realmprocessor'], annotation_processor_deps = [':realm'] )
Comments
Post a Comment