Bug 1102488 - Part 3: Output preprocessed files into generated/preprocessed. r=rnewman
authorNick Alexander <nalexander@mozilla.com>
Thu, 20 Nov 2014 14:25:52 -0800
changeset 217431 7a2706f87fe601251a119b8ba390ffa7fac592e9
parent 217430 840208e80c41509e3e58ec90e934524a75891231
child 217432 f2d2962cc060c6b523d2adac2061b67624ad1c76
push id27881
push userryanvm@gmail.com
push dateTue, 25 Nov 2014 21:47:13 +0000
treeherdermozilla-central@bca4892bbe03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1102488
milestone36.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 1102488 - Part 3: Output preprocessed files into generated/preprocessed. r=rnewman (Pushing to a CLOSED TREE because this is Android only.) The preprocessed files, all of which are constant exports, are exposed in the new constants JAR.
mobile/android/base/Makefile.in
mobile/android/base/android-services.mozbuild
mobile/android/base/moz.build
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -187,35 +187,36 @@ jni-stubs.inc: gecko-browser.jar gecko-m
 	$(PYTHON) $(topsrcdir)/mobile/android/base/jni-generator.py javah.out $@
 
 ANNOTATION_PROCESSOR_JAR_FILES := $(DEPTH)/build/annotationProcessors/annotationProcessors.jar
 
 GeneratedJNIWrappers.cpp: $(ANNOTATION_PROCESSOR_JAR_FILES)
 GeneratedJNIWrappers.cpp: $(ALL_JARS)
 	$(JAVA) -classpath gecko-mozglue.jar:$(JAVA_BOOTCLASSPATH):$(JAVA_CLASSPATH):$(ANNOTATION_PROCESSOR_JAR_FILES) org.mozilla.gecko.annotationProcessors.AnnotationProcessor $(ALL_JARS)
 
-# These _PP_JAVAFILES are specified in moz.build and defined in
-# backend.mk, which is included by config.mk.  Therefore this needs to
-# be defined after config.mk is included.
-PP_JAVAFILES := $(filter-out generated/org/mozilla/gecko/R.java,$(gecko-mozglue_PP_JAVAFILES) $(gecko-browser_PP_JAVAFILES) $(constants_PP_JAVAFILES))
-
 manifest := \
   AndroidManifest.xml.in \
   WebappManifestFragment.xml.frag.in \
   $(NULL)
 
 PP_TARGETS += manifest
 
 # 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.
 
-preprocessed := $(addsuffix .in,$(subst generated/org/mozilla/gecko/,,$(filter generated/org/mozilla/gecko/%,$(PP_JAVAFILES))))
+# The list in moz.build looks like
+# 'preprocessed/org/mozilla/gecko/AppConstants.java'.  The list in
+# constants_PP_JAVAFILES looks like
+# 'generated/preprocessed/org/mozilla/gecko/AppConstants.java'.  We
+# need to write AppConstants.java.in to
+# generated/preprocessed/org/mozilla/gecko.
+preprocessed := $(addsuffix .in,$(subst generated/preprocessed/org/mozilla/gecko/,,$(filter generated/preprocessed/org/mozilla/gecko/%,$(constants_PP_JAVAFILES))))
 
-preprocessed_PATH := generated/org/mozilla/gecko
+preprocessed_PATH := generated/preprocessed/org/mozilla/gecko
 preprocessed_KEEP_PATH := 1
 preprocessed_FLAGS := --marker='//\\\#'
 
 PP_TARGETS += preprocessed
 
 include $(topsrcdir)/config/rules.mk
 
 not_android_res_files := \
--- a/mobile/android/base/android-services.mozbuild
+++ b/mobile/android/base/android-services.mozbuild
@@ -1132,13 +1132,13 @@ sync_java_files = [
     'sync/Utils.java',
     'tokenserver/TokenServerClient.java',
     'tokenserver/TokenServerClientDelegate.java',
     'tokenserver/TokenServerException.java',
     'tokenserver/TokenServerToken.java',
 ]
 
 sync_generated_java_files = [
-    'org/mozilla/gecko/background/common/GlobalConstants.java',
-    'org/mozilla/gecko/background/healthreport/HealthReportConstants.java',
-    'org/mozilla/gecko/fxa/FxAccountConstants.java',
-    'org/mozilla/gecko/sync/SyncConstants.java',
+    'background/common/GlobalConstants.java',
+    'background/healthreport/HealthReportConstants.java',
+    'fxa/FxAccountConstants.java',
+    'sync/SyncConstants.java',
 ]
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -9,19 +9,20 @@ SPHINX_TREES['fennec'] = 'docs'
 
 include('android-services.mozbuild')
 
 thirdparty_source_dir = TOPSRCDIR + '/mobile/android/thirdparty/'
 
 constants_jar = add_java_jar('constants')
 constants_jar.sources = []
 constants_jar.generated_sources = [
-    'org/mozilla/gecko/AppConstants.java',
-    'org/mozilla/gecko/SysInfo.java',
+    'preprocessed/org/mozilla/gecko/AppConstants.java',
+    'preprocessed/org/mozilla/gecko/SysInfo.java',
 ]
+constants_jar.generated_sources += ['preprocessed/org/mozilla/gecko/' + f for f in sync_generated_java_files]
 
 resjar = add_java_jar('gecko-R')
 resjar.sources = []
 resjar.generated_sources += [
     'org/mozilla/gecko/R.java',
 ]
 
 if CONFIG['MOZ_NATIVE_DEVICES']:
@@ -544,17 +545,16 @@ if CONFIG['MOZ_ANDROID_NEW_TABLET_UI'] a
         'tabs/TabStrip.java',
         'tabs/TabStripAdapter.java',
         'tabs/TabStripItemView.java',
         'tabs/TabStripView.java'
     ]
     ANDROID_RES_DIRS += [ SRCDIR + '/newtablet/res' ]
 
 gbjar.sources += sync_java_files
-gbjar.generated_sources += sync_generated_java_files
 gbjar.extra_jars += [
     'gecko-R.jar',
     'gecko-mozglue.jar',
     'gecko-thirdparty.jar',
     'gecko-util.jar',
     'sync-thirdparty.jar',
 ]
 
@@ -789,21 +789,18 @@ if CONFIG['MOZ_NATIVE_DEVICES']:
     main.extra_jars += moz_native_devices_jars
 else:
     cpe.exclude_patterns += moz_native_devices_sources
 
 # The generated/ directory includes both files generated by aapt (R.java and
 # Manifest.java for all packages) but also preprocessed files. In the past, the
 # generated R.java files were used by the Eclipse build, but now Eclipse
 # generates these files itself. Therefore, we exclude those generated sources.
-main.add_classpathentry('generated', OBJDIR + '/generated',
-    dstdir='generated',
-    exclude_patterns=[
-        '**/R.java',
-        '**/Manifest.java'])
+main.add_classpathentry('generated', OBJDIR + '/generated/preprocessed',
+    dstdir='generated')
 main.add_classpathentry('thirdparty', TOPSRCDIR + '/mobile/android/thirdparty',
     dstdir='thirdparty',
     ignore_warnings=True)
 
 # Eclipse generates org.mozilla.gecko.R for this project, which is referenced by
 # all the Java code. The reason that this is not generated in the main Fennec
 # project is that you cannot specify a custom package to the Eclipse Android
 # builder; that is, the Eclipse Android builder always builds the