aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2015-11-24 14:36:05 +0000
committerPaul Duffin <paulduffin@google.com>2015-11-24 14:36:05 +0000
commit32e4569b127e4cbcdbd41cba885b4ce90ca02698 (patch)
tree15e92c24d7c0dc1b6d8b2fe55d18378907e79ff2
parent5d3207ac2713386ed61c6ca8f0356e8f093a62e1 (diff)
downloaddagger2-32e4569b127e4cbcdbd41cba885b4ce90ca02698.tar.gz
Work around limitation in code indexing tool
A code indexing tool does not support the default discovery of annotation processors or using the -classpath as the default class path to search for annotation processor classes so they both have to be specified explicitly using -processor and -processorpath respectively. At the moment this hard codes the path to an intermediate file, this should be a temporary measure either until a better way of building the -processorpath is found, -processorpath defaults to -classpath, or until default discovery works properly. Change-Id: I6224041972d1ef8d60fd153263bb0a1468114d03
-rw-r--r--Android.mk20
1 files changed, 20 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 08b6af514..706982d23 100644
--- a/Android.mk
+++ b/Android.mk
@@ -70,6 +70,26 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
dagger2-producers-host \
guavalib
+# Disable the default discovery for annotation processors and explicitly specify
+# the path and classes needed. This is needed because otherwise it breaks a code
+# indexing tool that doesn't, as yet do automatic discovery.
+PROCESSOR_JARS := \
+ $(LOCAL_PATH)/../../out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/javalib.jar \
+ $(LOCAL_PATH)/lib/auto-common-1.0-20151022.071545-39$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(LOCAL_PATH)/lib/auto-factory-1.0-20150915.183854-35$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(LOCAL_PATH)/lib/auto-service-1.0-rc2$(COMMON_JAVA_PACKAGE_SUFFIX) \
+ $(LOCAL_PATH)/lib/auto-value-1.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
+
+PROCESSOR_CLASSES := \
+ com.google.auto.factory.processor.AutoFactoryProcessor \
+ com.google.auto.service.processor.AutoServiceProcessor \
+ com.google.auto.value.processor.AutoAnnotationProcessor \
+ com.google.auto.value.processor.AutoValueProcessor
+
+LOCAL_JAVACFLAGS += -processorpath $(subst $(space),:,$(strip $(PROCESSOR_JARS)))
+
+LOCAL_JAVACFLAGS += -processor $(subst $(space),$(comma),$(strip $(PROCESSOR_CLASSES)))
+
#LOCAL_JACK_ENABLED := disabled
include $(BUILD_HOST_JAVA_LIBRARY)