Bug xxxxxx - Move DIST_FILES to moz.build
authorBrian O'Keefe <bokeefe@alum.wpi.edu>
Wed, 04 Feb 2015 12:12:02 -0500
changeset 401466 7dc6fde291ae31a45e40547c36fb6a4383331900
parent 401465 a851865d1bed75319b54d133490009709f85f9ed
child 401467 b603e2536588b6a0f3325861932fc39a576ec1c1
push id56269
push userbokeefe@alum.wpi.edu
push dateFri, 27 Feb 2015 22:06:13 +0000
treeherdertry@b3d0bfdb446f [default view] [failures only]
milestone39.0a1
Bug xxxxxx - Move DIST_FILES to moz.build
build/Makefile.in
build/moz.build
dom/indexedDB/test/extensions/Makefile.in
dom/indexedDB/test/extensions/moz.build
dom/workers/test/extensions/bootstrap/Makefile.in
dom/workers/test/extensions/bootstrap/moz.build
dom/workers/test/extensions/traditional/Makefile.in
dom/workers/test/extensions/traditional/moz.build
layout/tools/reftest/Makefile.in
layout/tools/reftest/moz.build
mobile/android/base/Makefile.in
mobile/android/base/moz.build
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/frontend/emitter.py
testing/mochitest/Makefile.in
testing/mochitest/moz.build
testing/specialpowers/Makefile.in
testing/specialpowers/moz.build
tools/quitter/Makefile.in
tools/quitter/moz.build
xulrunner/examples/simple/Makefile.in
xulrunner/examples/simple/moz.build
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -2,23 +2,16 @@
 # 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/.
 
 USE_RCS_MK := 1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
 ifdef MOZ_APP_BASENAME
-DIST_FILES = $(srcdir)/application.ini
-
-ifneq (android,$(MOZ_WIDGET_TOOLKIT))
-ifdef MOZ_UPDATER
-DIST_FILES += update-settings.ini
-endif
-endif
 
 ifdef LIBXUL_SDK
 APP_INI_DEPS = $(LIBXUL_DIST)/bin/platform.ini
 else
 APP_INI_DEPS = $(topsrcdir)/config/milestone.txt
 endif
 
 APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
--- a/build/moz.build
+++ b/build/moz.build
@@ -44,16 +44,26 @@ for var in ('MOZ_CRASHREPORTER', 'MOZ_PR
     if CONFIG[var]:
         DEFINES[var] = True
 
 if CONFIG['MOZ_BUILD_APP'] == 'browser':
     PYTHON_UNIT_TESTS += [
         'compare-mozconfig/compare-mozconfigs-wrapper.py',
     ]
 
+if CONFIG['MOZ_APP_BASENAME']:
+    DIST_FILES += [
+        'application.ini',
+    ]
+
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
+        DIST_FILES += [
+            'update-settings.ini',
+        ]
+
 if CONFIG['ENABLE_TESTS'] or CONFIG['MOZ_DMD']:
     tools_dir = TOPSRCDIR + '/tools/rb/'
     FINAL_TARGET_FILES += [tools_dir + 'fix_stack_using_bpsyms.py']
     if CONFIG['OS_ARCH'] == 'Darwin':
         FINAL_TARGET_FILES += [tools_dir + 'fix_macosx_stack.py']
     if CONFIG['OS_ARCH'] == 'Linux':
         FINAL_TARGET_FILES += [tools_dir + 'fix_linux_stack.py']
 
--- a/dom/indexedDB/test/extensions/Makefile.in
+++ b/dom/indexedDB/test/extensions/Makefile.in
@@ -1,17 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  bootstrap.js \
-  install.rdf \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/indexedDB/test/extensions/moz.build
+++ b/dom/indexedDB/test/extensions/moz.build
@@ -1,7 +1,13 @@
 # -*- 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/.
 
 XPI_NAME = 'indexedDB'
+
+DIST_FILES += [
+    'bootstrap.js',
+    'install.rdf',
+]
+
--- a/dom/workers/test/extensions/bootstrap/Makefile.in
+++ b/dom/workers/test/extensions/bootstrap/Makefile.in
@@ -1,18 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  bootstrap.js \
-  install.rdf \
-  worker.js \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/workers/test/extensions/bootstrap/moz.build
+++ b/dom/workers/test/extensions/bootstrap/moz.build
@@ -1,7 +1,14 @@
 # -*- 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/.
 
 XPI_NAME = 'workerbootstrap'
+
+DIST_FILES += [
+    'bootstrap.js',
+    'install.rdf',
+    'worker.js',
+]
+
--- a/dom/workers/test/extensions/traditional/Makefile.in
+++ b/dom/workers/test/extensions/traditional/Makefile.in
@@ -1,17 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  install.rdf \
-  worker.js \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/workers/test/extensions/traditional/moz.build
+++ b/dom/workers/test/extensions/traditional/moz.build
@@ -11,8 +11,14 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'WorkerTest'
 
 EXTRA_COMPONENTS += [
     'WorkerTest.js',
     'WorkerTest.manifest',
 ]
 
 XPI_NAME = 'worker'
+
+DIST_FILES += [
+    'install.rdf',
+    'worker.js',
+]
+
--- a/layout/tools/reftest/Makefile.in
+++ b/layout/tools/reftest/Makefile.in
@@ -1,19 +1,13 @@
 # vim: set shiftwidth=8 tabstop=8 autoindent noexpandtab copyindent:
 # 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/.
 
-DIST_FILES = install.rdf
-
-ifeq ($(MOZ_BUILD_APP),mobile/android)
-DIST_FILES += bootstrap.js
-endif
-
 _DEST_DIR = $(DEPTH)/_tests/reftest
 
 _HARNESS_FILES = \
   $(srcdir)/runreftest.py \
   $(srcdir)/remotereftest.py \
   $(srcdir)/runreftestb2g.py \
   $(srcdir)/b2g_desktop.py \
   $(srcdir)/gaia_lock_screen.js \
--- a/layout/tools/reftest/moz.build
+++ b/layout/tools/reftest/moz.build
@@ -14,8 +14,18 @@ else:
         'reftest-cmdline.manifest',
     ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 USE_EXTENSION_MANIFEST = True
 
 XPI_NAME = 'reftest'
+
+DIST_FILES += [
+    'install.rdf',
+]
+
+if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
+    DIST_FILES += [
+        'bootstrap.js',
+    ]
+
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1,16 +1,12 @@
 # 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/.
 
-DIST_FILES := \
-  package-name.txt.in \
-  $(NULL)
-
 ifneq (,$(findstring -march=armv7,$(OS_CFLAGS)))
 MIN_CPU_VERSION=7
 else
 MIN_CPU_VERSION=5
 endif
 
 MOZ_APP_BUILDID=$(shell cat $(DEPTH)/config/buildid)
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -878,8 +878,13 @@ if CONFIG['MOZ_CRASHREPORTER']:
 
 if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
     main.included_projects += ['../FennecStumbler']
     main.referenced_projects += ['../FennecStumbler']
 
 if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
     # The Search Activity code is built as part of Fennec, so we follow suit in Eclipse.
     main.add_classpathentry('search', TOPSRCDIR + '/mobile/android/search/java', dstdir='search')
+
+DIST_FILES += [
+    'package-name.txt.in',
+]
+
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -611,16 +611,27 @@ VARIABLES = {
         For example, to export ``foo.png`` to the top-level directory and
         ``bar.svg`` to the directory ``images/do-not-use``, append to
         ``FINAL_TARGET_FILES`` like so::
 
            FINAL_TARGET_FILES += ['foo.png']
            FINAL_TARGET_FILES.images['do-not-use'] += ['bar.svg']
         """, None),
 
+    'DIST_FILES': (StrictOrderingOnAppendList, list,
+        """List of files to be installed into the application directory.
+
+        ``DIST_FILES`` works similarly to ``FINAL_TARGET_FILES``, with a few
+        additional requirements:
+        - Files can only be installed to ``FINAL_TARGET``.
+        - Files will be preprocessed. Anything specified in ``XULAPP_DEFINES``
+          or ``XULPPFLAGS``, in the Makefile.in, will be passed to the
+          preprocessor, along with ``DEFINES`` and ``AC_DEFINES``.
+        """, None),
+
     'DISABLE_STL_WRAPPING': (bool, bool,
         """Disable the wrappers for STL which allow it to work with C++ exceptions
         disabled.
         """, None),
 
     'EXTRA_COMPONENTS': (StrictOrderingOnAppendList, list,
         """Additional component files to distribute.
 
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -400,16 +400,17 @@ class TreeMetadataEmitter(LoggingMixin):
         # 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(context)
         varlist = [
             'ANDROID_GENERATED_RESFILES',
             'ANDROID_RES_DIRS',
             'DISABLE_STL_WRAPPING',
+            'DIST_FILES',
             'EXTRA_ASSEMBLER_FLAGS',
             'EXTRA_COMPILE_FLAGS',
             'EXTRA_COMPONENTS',
             'EXTRA_DSO_LDOPTS',
             'EXTRA_PP_COMPONENTS',
             'FAIL_ON_WARNINGS',
             'USE_STATIC_LIBS',
             'IS_GYP_DIR',
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -1,16 +1,14 @@
 #
 # 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/.
 
 NO_JS_MANIFEST = 1
-DIST_FILES = install.rdf
-
 _DEST_DIR = $(DEPTH)/_tests/$(relativesrcdir)
 
 include $(topsrcdir)/config/rules.mk
 # We're installing to _tests/testing/mochitest, so this is the depth
 # necessary for relative objdir paths.
 TARGET_DEPTH = ../../..
 include $(topsrcdir)/build/automation-build.mk
 
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -104,8 +104,13 @@ TEST_HARNESS_FILES.testing.mochitest.pyw
 ]
 
 TEST_HARNESS_FILES.testing.mochitest.pywebsocket.mod_pywebsocket.handshake += [
     'pywebsocket/mod_pywebsocket/handshake/__init__.py',
     'pywebsocket/mod_pywebsocket/handshake/_base.py',
     'pywebsocket/mod_pywebsocket/handshake/hybi.py',
     'pywebsocket/mod_pywebsocket/handshake/hybi00.py',
 ]
+
+DIST_FILES += [
+    'install.rdf',
+]
+
--- a/testing/specialpowers/Makefile.in
+++ b/testing/specialpowers/Makefile.in
@@ -1,18 +1,14 @@
 #
 # 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/.
 
 NO_JS_MANIFEST = 1
-DIST_FILES = \
-  install.rdf \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/testing/specialpowers
 
 include $(topsrcdir)/config/rules.mk
 
 libs-preqs = \
   $(call mkdir_deps,$(TEST_EXTENSIONS_DIR)) \
   $(NULL)
 
--- a/testing/specialpowers/moz.build
+++ b/testing/specialpowers/moz.build
@@ -11,8 +11,12 @@ EXTRA_COMPONENTS += [
 XPI_NAME = 'specialpowers'
 
 JAR_MANIFESTS += ['jar.mn']
 
 USE_EXTENSION_MANIFEST = True
 
 MOZ_CHROME_FILE_FORMAT = 'flat'
 
+DIST_FILES += [
+    'install.rdf',
+]
+
--- a/tools/quitter/Makefile.in
+++ b/tools/quitter/Makefile.in
@@ -1,13 +1,8 @@
 #
 # 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/.
 
 XPI_PKGNAME = quitter@mozilla.org
 NO_JS_MANIFEST = 1
 
-DIST_FILES = \
-  install.rdf \
-  chrome.manifest \
-  $(NULL)
-
--- a/tools/quitter/moz.build
+++ b/tools/quitter/moz.build
@@ -9,8 +9,13 @@ EXTRA_COMPONENTS += [
 ]
 
 XPI_NAME = 'quitter'
 
 JAR_MANIFESTS += ['jar.mn']
 
 USE_EXTENSION_MANIFEST = True
 
+DIST_FILES += [
+    'chrome.manifest',
+    'install.rdf',
+]
+
--- a/xulrunner/examples/simple/Makefile.in
+++ b/xulrunner/examples/simple/Makefile.in
@@ -1,15 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
-DIST_FILES	= application.ini
-
 ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 ICONS		= icons/simple.ico
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifneq (,$(ICONS))
 libs:: $(ICONS)
--- a/xulrunner/examples/simple/moz.build
+++ b/xulrunner/examples/simple/moz.build
@@ -9,8 +9,12 @@ DIRS += ['components']
 XPI_NAME = 'simple'
 
 JAR_MANIFESTS += ['jar.mn']
 
 JS_PREFERENCE_FILES += [
     'simple-prefs.js',
 ]
 
+DIST_FILES += [
+    'application.ini',
+]
+