In case anyone stumbles on this, the way to use annotation processors with buckbuild is:
- The
annotation_processors
is a immutable list of processor class. You can identify this by the package name used in META-INF/services/javax.annotation.processing.Processor file, example: Realm Processor
- The
annotation_processor_deps
is a immutable list of Rules (generally prebuilt_jar
or android_prebuilt_aar
) holding the annotation processor
A sample buck build file of a project that 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']
)