Bug 1278008 - Add all_jars to annotation processing classpath. r=sebastian draft
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 06 Jun 2016 10:30:21 -0700
changeset 375784 bf9d6cb3886953fb579abb6de642b9b5bee3a9e3
parent 375783 c43b996c63c7ad4e852c4abd9e46b865f4ca19b4
child 522970 8319575b99945c23ff2988b8412c484d19b4ec92
push id20383
push usermichael.l.comella@gmail.com
push dateMon, 06 Jun 2016 18:04:50 +0000
reviewerssebastian
bugs1278008
milestone49.0a1
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
mobile/android/base/Makefile.in
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -300,17 +300,27 @@ jni-stubs.inc: gecko-browser.jar constan
 	$(PYTHON) $(topsrcdir)/mobile/android/base/jni-generator.py javah.out $@
 
 ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
 
 # This annotation processing step also generates
 # 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
 # consumption by the build system and IDEs.
 
 # The list in moz.build looks like
 # 'preprocessed/org/mozilla/gecko/AppConstants.java'.  The list in
 # constants_PP_JAVAFILES looks like