From ac5f092653fbc6209a0c5bba91bf0d7bf0b7f749 Mon Sep 17 00:00:00 2001 From: Tony Cosentini Date: Tue, 2 Feb 2016 14:33:30 -0800 Subject: [PATCH] Target JDK 1.7 for annotations and processor jar for Android. Summary: The annotations won't work on Android unless you target JDK 1.7 (otherwise it can't DEX the app or library). Closes https://github.com/facebook/infer/pull/257 Reviewed By: jeremydubreil Differential Revision: D2889334 Pulled By: sblackshear fb-gh-sync-id: c09adaa --- infer/annotations/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/infer/annotations/Makefile b/infer/annotations/Makefile index e6deb6dda..7c7ea9d60 100644 --- a/infer/annotations/Makefile +++ b/infer/annotations/Makefile @@ -14,6 +14,7 @@ ANNOT_SOURCES = $(shell find com/facebook/infer/annotation -name "*.java") PROCESSOR_SOURCES = $(shell find com/facebook/infer/annotprocess -name "*.java") ANNOT_CLASSES = 'annot_classes' PROCESSOR_CLASSES = 'processor_classes' +TARGET_JDK_VERSION = '1.7' ANNOTATIONS_JAR = $(CWD)/annotations.jar PROCESSOR_JAR = $(JAVA_LIB_DIR)/processor.jar @@ -22,12 +23,12 @@ all: $(ANNOTATIONS_JAR) $(PROCESSOR_JAR) $(ANNOTATIONS_JAR): $(ANNOT_SOURCES) mkdir -p $(ANNOT_CLASSES) - javac -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) + javac -source $(TARGET_JDK_VERSION) -target $(TARGET_JDK_VERSION) -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com $(PROCESSOR_JAR): $(PROCESSOR_SOURCES) mkdir -p $(PROCESSOR_CLASSES) - javac $(PROCESSOR_SOURCES) -cp .:$(JAVA_HOME)/lib/tools.jar -d $(PROCESSOR_CLASSES) + javac -source $(TARGET_JDK_VERSION) -target $(TARGET_JDK_VERSION) $(PROCESSOR_SOURCES) -cp .:$(JAVA_HOME)/lib/tools.jar -d $(PROCESSOR_CLASSES) jar cvMf processor.jar -C resources META-INF -C $(PROCESSOR_CLASSES) com mv processor.jar $(PROCESSOR_JAR)