From 908e78cc8112ccf15222effda79802be78fecab6 Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Mon, 23 Jan 2017 15:29:33 -0800 Subject: [PATCH] [annotations] produce a sources JAR for the infer annotations Summary: Some of the new thread-safety annotations are somewhat difficult to understand based on the name alone. Devs can link a sources JAR with the annotations in their IDE to quickly understand the purpose of each annotation. Reviewed By: jeremydubreil Differential Revision: D4451748 fbshipit-source-id: 1ba6060 --- .gitignore | 2 +- infer/annotations/Makefile | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5ee9cb408..842523651 100644 --- a/.gitignore +++ b/.gitignore @@ -117,7 +117,7 @@ buck-out/ /infer/annotations/annot_classes/ /infer/annotations/annotations.jar -/infer/annotations/processor_classes/ +/infer/annotations/annotations-src.jar infer/src/.project /dependencies/ocamldot/ocamldot /dependencies/ocamldot/ocamldot.ml diff --git a/infer/annotations/Makefile b/infer/annotations/Makefile index 970b2adb7..61135f6e4 100644 --- a/infer/annotations/Makefile +++ b/infer/annotations/Makefile @@ -14,14 +14,19 @@ ANNOT_SOURCES = $(shell find com/facebook/infer/annotation -name "*.java") ANNOT_CLASSES = 'annot_classes' ANNOTATIONS_JAR = $(CWD)/annotations.jar +SOURCES_JAR = $(CWD)/annotations-src.jar -all: $(ANNOTATIONS_JAR) +all: $(ANNOTATIONS_JAR) $(SOURCES_JAR) $(ANNOTATIONS_JAR): $(ANNOT_SOURCES) mkdir -p $(ANNOT_CLASSES) javac -source 7 -target 7 -cp $(JSR_JAR) $(ANNOT_SOURCES) -d $(ANNOT_CLASSES) cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com +$(SOURCES_JAR): $(ANNOT_SOURCES) + jar cvf $(SOURCES_JAR) com + clean: @rm -rf $(ANNOT_CLASSES) @rm -f $(ANNOTATIONS_JAR) + @rm -f $(SOURCES_JAR)