Bug 923306 - Build annotationProcessors with JAVA_JAR_TARGETS. r=glandium
authorNick Alexander <nalexander@mozilla.com>
Wed, 09 Oct 2013 17:05:37 -0700
changeset 150315 905feca3578b4aef357eefaa0eb26e0ee98401aa
parent 150314 61b6e63fe7f94e641cc983bdd379507fcdc07db8
child 150316 5055f99ce7c9f8723066b0937bd96770553a7980
push id34821
push usercbook@mozilla.com
push dateThu, 10 Oct 2013 11:42:34 +0000
treeherdermozilla-inbound@655490859d77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs923306
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 923306 - Build annotationProcessors with JAVA_JAR_TARGETS. r=glandium
build/annotationProcessors/Makefile.in
build/annotationProcessors/moz.build
build/moz.build
mobile/android/base/Makefile.in
new file mode 100644
--- /dev/null
+++ b/build/annotationProcessors/Makefile.in
@@ -0,0 +1,25 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+JAVA_JAR_TARGETS += annotationProcessors
+annotationProcessors_DEST := annotationProcessors.jar
+annotationProcessors_JAVAFILES := \
+  AnnotationProcessor.java \
+  CodeGenerator.java \
+  MethodWithAnnotationInfo.java \
+  classloader/IterableJarLoadingURLClassLoader.java \
+  classloader/JarClassIterator.java \
+  utils/AlphabeticMethodComparator.java \
+  utils/GeneratableEntryPointIterator.java \
+  utils/Utils.java \
+  $(NULL)
+
+include $(topsrcdir)/config/rules.mk
+
+JAVA_CLASSPATH := $(ANDROID_SDK)/android.jar
+
+# Include Android specific java flags, instead of what's in rules.mk.
+include $(topsrcdir)/config/android-common.mk
+
+libs:: annotationProcessors.jar
new file mode 100644
--- /dev/null
+++ b/build/annotationProcessors/moz.build
@@ -0,0 +1,5 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
--- a/build/moz.build
+++ b/build/moz.build
@@ -8,16 +8,17 @@ if CONFIG['OS_ARCH'] not in ('WINNT', 'O
     DIRS += ['unix']
 elif CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['win32']
 
 if CONFIG['OS_TARGET'] == 'Android' and not CONFIG['MOZ_ANDROID_LIBSTDCXX']:
     DIRS += ['stlport']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
+    DIRS += ['annotationProcessors']
     TEST_DIRS += [
         'mobile/sutagent/android',
         'mobile/sutagent/android/watcher',
         'mobile/sutagent/android/ffxcp',
         'mobile/sutagent/android/fencp',
         'mobile/robocop',
     ]
 
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1330,30 +1330,21 @@ ifdef MOZ_WEBSMS_BACKEND
 # like the error message says and rebuild. All should be well after that.
 CLASSES_WITH_JNI += org.mozilla.gecko.GeckoSmsManager
 endif
 
 jni-stubs.inc: jars/gecko-browser.jar jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar
 	$(JAVAH) -o javah.out -bootclasspath $(JAVA_BOOTCLASSPATH) -classpath $(subst $(NULL) $(NULL),:,$^) $(CLASSES_WITH_JNI)
 	$(PYTHON) $(topsrcdir)/mobile/android/base/jni-generator.py javah.out $@
 
-ANNOTATION_PROCESSOR_JAVA_FILES = \
-  build/annotationProcessors/AnnotationProcessor.java \
-  build/annotationProcessors/CodeGenerator.java \
-  build/annotationProcessors/MethodWithAnnotationInfo.java \
-  build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java \
-  build/annotationProcessors/classloader/JarClassIterator.java \
-  build/annotationProcessors/utils/AlphabeticMethodComparator.java \
-  build/annotationProcessors/utils/GeneratableEntryPointIterator.java \
-  build/annotationProcessors/utils/Utils.java \
-  $(NULL)
+ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
 
-GeneratedJNIWrappers.cpp: jars/gecko-browser.jar jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar
-	$(JAVAC) $(addprefix $(topsrcdir)/,$(ANNOTATION_PROCESSOR_JAVA_FILES)) -d $(CURDIR)
-	$(JAVA) -classpath $(JAVA_BOOTCLASSPATH):$(CURDIR) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $^
+GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES)
+GeneratedJNIWrappers.cpp: $(ALL_JARS)
+	$(JAVA) -classpath $(JAVA_BOOTCLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
 
 PP_RES_XML= \
   $(SYNC_PP_RES_XML) \
   $(FENNEC_PP_XML_FILES) \
   $(NULL)
 
 # This is kinda awful; if any of the source files change, we remake them all.
 $(PP_RES_XML): $(patsubst res/%,$(srcdir)/resources/%.in,$(PP_RES_XML))