Bug 900522 - Part 3: Add passthru ANDROID_GENERATED_RESFILES. r=gps
authorNick Alexander <nalexander@mozilla.com>
Wed, 09 Oct 2013 16:19:00 -0700
changeset 165814 e85fb9e5291a5726c432d7afd50ed5ff4c030228
parent 165813 b63f1891d3e94d18f057dfd9bee58d69af3969b6
child 165815 19a4955c789b4c3c7959d1a40b014b134770ca62
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs900522
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 900522 - Part 3: Add passthru ANDROID_GENERATED_RESFILES. r=gps This defines all of the Android resources in moz.build files (although some are still generated by mobile/android/base/Makefile.in).
config/rules.mk
js/src/config/rules.mk
mobile/android/base/Makefile.in
mobile/android/base/moz.build
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/frontend/sandbox_symbols.py
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -16,16 +16,17 @@ ifdef INCLUDED_RULES_MK
 endif
 INCLUDED_RULES_MK = 1
 
 # Integrate with mozbuild-generated make files. We first verify that no
 # variables provided by the automatically generated .mk files are
 # present. If they are, this is a violation of the separation of
 # responsibility between Makefile.in and mozbuild files.
 _MOZBUILD_EXTERNAL_VARIABLES := \
+  ANDROID_GENERATED_RESFILES \
   ANDROID_RESFILES \
   CMMSRCS \
   CPP_UNIT_TESTS \
   DIRS \
   EXTRA_PP_COMPONENTS \
   EXTRA_PP_JS_MODULES \
   GTEST_CMMSRCS \
   GTEST_CPPSRCS \
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -16,16 +16,17 @@ ifdef INCLUDED_RULES_MK
 endif
 INCLUDED_RULES_MK = 1
 
 # Integrate with mozbuild-generated make files. We first verify that no
 # variables provided by the automatically generated .mk files are
 # present. If they are, this is a violation of the separation of
 # responsibility between Makefile.in and mozbuild files.
 _MOZBUILD_EXTERNAL_VARIABLES := \
+  ANDROID_GENERATED_RESFILES \
   ANDROID_RESFILES \
   CMMSRCS \
   CPP_UNIT_TESTS \
   DIRS \
   EXTRA_PP_COMPONENTS \
   EXTRA_PP_JS_MODULES \
   GTEST_CMMSRCS \
   GTEST_CPPSRCS \
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -600,24 +600,20 @@ ANDROID_RESDIRS := $(subst resources/,re
 
 res/values/strings.xml: $(call mkdir_deps,res/values)
 	$(MAKE) -C locales
 
 # With multilocale builds, there will be multiple strings.xml files. We need to
 # rebuild gecko.ap_ if any of them change.
 MULTILOCALE_STRINGS_XML_FILES := $(wildcard res/values-*/strings.xml)
 all_resources = \
-  res/drawable-mdpi/icon.png \
-  res/drawable-hdpi/icon.png \
-  res/drawable-xhdpi/icon.png \
-  res/drawable-xxhdpi/icon.png \
-  res/values/strings.xml \
   $(MULTILOCALE_STRINGS_XML_FILES) \
   AndroidManifest.xml \
   $(subst resources/,res/,$(ANDROID_RESFILES)) \
+  $(ANDROID_GENERATED_RESFILES) \
   $(NULL)
 
 R.java: $(all_resources)
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko --non-constant-id
 
 gecko.ap_: $(all_resources)
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar  -S res -F $@
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -3,16 +3,24 @@
 # 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/.
 
 DIRS += ['locales']
 
 include('android-services.mozbuild')
 
+ANDROID_GENERATED_RESFILES += [
+    'res/drawable-hdpi/icon.png',
+    'res/drawable-mdpi/icon.png',
+    'res/drawable-xhdpi/icon.png',
+    'res/drawable-xxhdpi/icon.png',
+    'res/values/strings.xml',
+]
+
 ANDROID_RESFILES += [
     'resources/anim/grow_fade_in.xml',
     'resources/anim/grow_fade_in_center.xml',
     'resources/anim/popup_hide.xml',
     'resources/anim/popup_show.xml',
     'resources/anim/progress_spinner.xml',
     'resources/anim/shrink_fade_out.xml',
     'resources/color/primary_text.xml',
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -134,16 +134,17 @@ class TreeMetadataEmitter(LoggingMixin):
                         % (symbol, src, sandbox['RELATIVEDIR']))
 
         # Proxy some variables as-is until we have richer classes to represent
         # them. We should aim to keep this set small because it violates the
         # desired abstraction of the build definition away from makefiles.
         passthru = VariablePassthru(sandbox)
         varmap = dict(
             # Makefile.in : moz.build
+            ANDROID_GENERATED_RESFILES='ANDROID_GENERATED_RESFILES',
             ANDROID_RESFILES='ANDROID_RESFILES',
             ASFILES='ASFILES',
             CMMSRCS='CMMSRCS',
             CPPSRCS='CPP_SOURCES',
             CPP_UNIT_TESTS='CPP_UNIT_TESTS',
             CSRCS='CSRCS',
             EXPORT_LIBRARY='EXPORT_LIBRARY',
             EXTRA_COMPONENTS='EXTRA_COMPONENTS',
--- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
+++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py
@@ -38,16 +38,25 @@ from mozbuild.util import (
 #      programs and libraries.
 # - 'libs': everything that is not compile or binaries and that has
 #      traditionally been in the libs tier.
 # - 'tools'
 # A value of None means the variable has no direct effect on any tier.
 
 VARIABLES = {
     # Variables controlling reading of other frontend files.
+    'ANDROID_GENERATED_RESFILES': (StrictOrderingOnAppendList, list, [],
+        """Android resource files generated as part of the build.
+
+        This variable contains a list of files that are expected to be
+        generated (often by preprocessing) into a 'res' directory as
+        part of the build process, and subsequently merged into an APK
+        file.
+        """, 'export'),
+
     'ANDROID_RESFILES': (StrictOrderingOnAppendList, list, [],
         """Android resource files.
 
         This variable contains a list of files to package into a 'res'
         directory and merge into an APK file.
         """, 'export'),
 
     'ASFILES': (StrictOrderingOnAppendList, list, [],