Bug 1278008 - Add all_jars to annotation processing classpath. r=sebastian

Because I don't know much about the build system, this may not be an optimal
fix. See the added code comments for more details.

Since this is an annotation processor and they tend to be self-analyzing, my
one concern is that this code uses the classpath in some way to identify which
files need to be kept. That being said:
 1) I don't think it makes sense to use the classpath in this way, particularly
when the files we want to operate on are passed as a command line argument.
 2) My build did not warn me that the generated JNI wrappers have changed so I
expect no side effects from this change.

MozReview-Commit-ID: 5mm6TClO1Su

--HG--
extra : rebase_source : c1ae4f0e9972f9efd8d6593fcbf27a500a6e0b63
This commit is contained in:
Michael Comella 2016-06-06 10:30:21 -07:00
parent d1c8268ecb
commit 6aa25533cb

View File

@ -305,7 +305,17 @@ ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotation
# GeneratedJNIWrappers.h and GeneratedJNINatives.h
GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES)
GeneratedJNIWrappers.cpp: $(ALL_JARS)
$(JAVA) -classpath constants.jar:$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
# (bug 1278008) I added all_jars_classpath here but I'm not certain
# this is optimal. The annotation processor throws NoClassDefFoundError
# because it is missing the adjust SDK on its classpath so ideally,
# we'd just add that. However, another NoClassDefFoundError is thrown
# for HttpClient and I could not fix that.
#
# I don't want to spend too much time on this & it seems harmless to
# add the sources we're actively compiling to classpath of the
# annotation processor, which includes adjust & whatever lib we're
# missing for HttpClient, so I opted for this solution.
$(JAVA) -classpath $(all_jars_classpath):constants.jar:$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
# Certain source files need to be preprocessed. This special rule
# generates these files into generated/org/mozilla/gecko for