From 4246e6b6ea37c38b58438807a5665f287800e925 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 25 Jul 2014 13:40:07 -0400 Subject: [PATCH] Bug 1044162 - part 1 - make EXTRA_{PP_,}JS_MODULES communicate their installation path; r=mshal This patch makes EXTRA_{PP_,}JS_MODULES similar in functionality to TESTING_JS_MODULES: we indicate the path relative to $(FINAL_TARGET)/modules with an appropriate hierarchy of paths. --- accessible/jsat/moz.build | 4 +-- addon-sdk/moz.build | 4 +-- addon-sdk/source/modules/system/moz.build | 4 +-- browser/components/loop/moz.build | 4 +-- browser/components/sessionstore/moz.build | 6 ++-- browser/components/tabview/moz.build | 4 +-- browser/components/translation/moz.build | 4 +-- browser/devtools/app-manager/moz.build | 4 +-- browser/devtools/canvasdebugger/moz.build | 4 +-- browser/devtools/commandline/moz.build | 4 +-- browser/devtools/debugger/moz.build | 4 +-- browser/devtools/eyedropper/moz.build | 4 +-- browser/devtools/inspector/moz.build | 4 +-- browser/devtools/markupview/moz.build | 4 +-- browser/devtools/moz.build | 4 +-- browser/devtools/netmonitor/moz.build | 4 +-- browser/devtools/profiler/moz.build | 4 +-- browser/devtools/responsivedesign/moz.build | 4 +-- browser/devtools/scratchpad/moz.build | 4 +-- browser/devtools/shadereditor/moz.build | 4 +-- browser/devtools/sourceeditor/moz.build | 4 +-- browser/devtools/styleinspector/moz.build | 4 +-- browser/devtools/tilt/moz.build | 4 +-- browser/devtools/webaudioeditor/moz.build | 4 +-- browser/devtools/webconsole/moz.build | 4 +-- browser/devtools/webide/moz.build | 4 +-- browser/experiments/moz.build | 4 +-- dom/media/moz.build | 4 +-- .../mozbuild/backend/recursivemake.py | 30 +++++++++++++++++-- python/mozbuild/mozbuild/frontend/emitter.py | 10 +++++-- .../mozbuild/frontend/sandbox_symbols.py | 4 +-- .../backend/data/variable_passthru/moz.build | 3 -- .../test/backend/test_recursivemake.py | 8 ----- .../frontend/data/variable-passthru/moz.build | 3 -- .../mozbuild/test/frontend/test_emitter.py | 2 -- services/metrics/moz.build | 4 +-- toolkit/components/osfile/modules/moz.build | 4 +-- .../components/promiseworker/worker/moz.build | 4 +-- toolkit/components/sqlite/moz.build | 4 +-- toolkit/components/workerloader/moz.build | 4 +-- toolkit/components/workerlz4/moz.build | 4 +-- toolkit/crashreporter/test/Makefile.in | 2 +- toolkit/devtools/acorn/moz.build | 4 +-- toolkit/devtools/apps/moz.build | 4 +-- toolkit/devtools/discovery/moz.build | 4 +-- toolkit/devtools/jsbeautify/moz.build | 4 +-- toolkit/devtools/pretty-fast/moz.build | 4 +-- toolkit/devtools/qrcode/decoder/moz.build | 4 +-- toolkit/devtools/qrcode/encoder/moz.build | 4 +-- toolkit/devtools/qrcode/moz.build | 4 +-- toolkit/devtools/styleinspector/moz.build | 4 +-- toolkit/devtools/tern/moz.build | 4 +-- toolkit/devtools/transport/moz.build | 4 +-- toolkit/devtools/webconsole/moz.build | 4 +-- toolkit/identity/moz.build | 6 ++-- toolkit/mozapps/extensions/internal/moz.build | 6 ++-- 56 files changed, 90 insertions(+), 170 deletions(-) diff --git a/accessible/jsat/moz.build b/accessible/jsat/moz.build index 9f6f7f21d34..1609f6f6785 100644 --- a/accessible/jsat/moz.build +++ b/accessible/jsat/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/accessibility' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.accessibility += [ 'AccessFu.jsm', 'Constants.jsm', 'ContentControl.jsm', diff --git a/addon-sdk/moz.build b/addon-sdk/moz.build index ed40b41bbdc..84bf2dd65a3 100644 --- a/addon-sdk/moz.build +++ b/addon-sdk/moz.build @@ -8,8 +8,6 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] DIRS += ["source/modules/system"] -JS_MODULES_PATH = 'modules/sdk' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.sdk += [ 'source/app-extension/bootstrap.js', ] diff --git a/addon-sdk/source/modules/system/moz.build b/addon-sdk/source/modules/system/moz.build index 4b08c94b774..5d2ca41b94e 100644 --- a/addon-sdk/source/modules/system/moz.build +++ b/addon-sdk/source/modules/system/moz.build @@ -4,8 +4,6 @@ # 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/. -JS_MODULES_PATH = 'modules/sdk/system' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.sdk.system += [ 'XulApp.js', ] diff --git a/browser/components/loop/moz.build b/browser/components/loop/moz.build index 61dc28e0b65..a03b8a94581 100644 --- a/browser/components/loop/moz.build +++ b/browser/components/loop/moz.build @@ -6,15 +6,13 @@ JAR_MANIFESTS += ['jar.mn'] -JS_MODULES_PATH = 'modules/loop' - XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini'] BROWSER_CHROME_MANIFESTS += [ 'test/mochitest/browser.ini', ] -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.loop += [ 'MozLoopAPI.jsm', 'MozLoopPushHandler.jsm', 'MozLoopService.jsm', diff --git a/browser/components/sessionstore/moz.build b/browser/components/sessionstore/moz.build index 9f6d8091d1c..863efecc376 100644 --- a/browser/components/sessionstore/moz.build +++ b/browser/components/sessionstore/moz.build @@ -22,9 +22,7 @@ EXTRA_COMPONENTS += [ 'nsSessionStore.manifest', ] -JS_MODULES_PATH = 'modules/sessionstore' - -EXTRA_JS_MODULES = [ +EXTRA_JS_MODULES.sessionstore = [ 'ContentRestore.jsm', 'DocShellCapabilities.jsm', 'FrameTree.jsm', @@ -46,7 +44,7 @@ EXTRA_JS_MODULES = [ 'Utils.jsm', ] -EXTRA_PP_JS_MODULES += [ +EXTRA_PP_JS_MODULES.sessionstore += [ 'SessionSaver.jsm', 'SessionStore.jsm', ] diff --git a/browser/components/tabview/moz.build b/browser/components/tabview/moz.build index 7416c2d6321..7364c484864 100644 --- a/browser/components/tabview/moz.build +++ b/browser/components/tabview/moz.build @@ -4,9 +4,7 @@ # 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/. -EXTRA_JS_MODULES = ['modules/utils.jsm'] -JS_MODULES_PATH = 'modules/tabview' - +EXTRA_JS_MODULES.tabview = ['modules/utils.jsm'] BROWSER_CHROME_MANIFESTS += [ 'test/browser.ini', ] diff --git a/browser/components/translation/moz.build b/browser/components/translation/moz.build index 9e665587931..88afe79075b 100644 --- a/browser/components/translation/moz.build +++ b/browser/components/translation/moz.build @@ -2,9 +2,7 @@ # 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/. -JS_MODULES_PATH = 'modules/translation' - -EXTRA_JS_MODULES = [ +EXTRA_JS_MODULES.translation = [ 'BingTranslator.jsm', 'cld2/cld-worker.js', 'cld2/cld-worker.js.mem', diff --git a/browser/devtools/app-manager/moz.build b/browser/devtools/app-manager/moz.build index 4dee9226e7b..7d33c95625d 100644 --- a/browser/devtools/app-manager/moz.build +++ b/browser/devtools/app-manager/moz.build @@ -7,9 +7,7 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini'] -JS_MODULES_PATH = 'modules/devtools/app-manager' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools["app-manager"] += [ 'app-projects.js', 'app-validator.js', 'builtin-adb-store.js', diff --git a/browser/devtools/canvasdebugger/moz.build b/browser/devtools/canvasdebugger/moz.build index 39e17e5b5a7..78ad27d5c78 100644 --- a/browser/devtools/canvasdebugger/moz.build +++ b/browser/devtools/canvasdebugger/moz.build @@ -3,9 +3,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/canvasdebugger' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.canvasdebugger += [ 'panel.js' ] diff --git a/browser/devtools/commandline/moz.build b/browser/devtools/commandline/moz.build index 322d5865dff..bad0b4a1497 100644 --- a/browser/devtools/commandline/moz.build +++ b/browser/devtools/commandline/moz.build @@ -2,9 +2,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/commandline' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.commandline += [ 'commands-index.js' ] diff --git a/browser/devtools/debugger/moz.build b/browser/devtools/debugger/moz.build index 90c8338e611..8276e2982dd 100644 --- a/browser/devtools/debugger/moz.build +++ b/browser/devtools/debugger/moz.build @@ -3,9 +3,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/debugger' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.debugger += [ 'debugger-commands.js', 'panel.js' ] diff --git a/browser/devtools/eyedropper/moz.build b/browser/devtools/eyedropper/moz.build index 8200a5e80c2..eb0b97086c8 100644 --- a/browser/devtools/eyedropper/moz.build +++ b/browser/devtools/eyedropper/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/eyedropper' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.eyedropper += [ 'commands.js', 'eyedropper.js' ] diff --git a/browser/devtools/inspector/moz.build b/browser/devtools/inspector/moz.build index f8eb56ec7b4..6974b5e608c 100644 --- a/browser/devtools/inspector/moz.build +++ b/browser/devtools/inspector/moz.build @@ -2,9 +2,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/inspector' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.inspector += [ 'breadcrumbs.js', 'inspector-commands.js', 'inspector-panel.js', diff --git a/browser/devtools/markupview/moz.build b/browser/devtools/markupview/moz.build index d9370477055..88571aaffda 100644 --- a/browser/devtools/markupview/moz.build +++ b/browser/devtools/markupview/moz.build @@ -6,9 +6,7 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] -JS_MODULES_PATH = 'modules/devtools/markupview' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.markupview += [ 'html-editor.js', 'markup-view.js', ] diff --git a/browser/devtools/moz.build b/browser/devtools/moz.build index 4fa5f2548f1..173405faac0 100644 --- a/browser/devtools/moz.build +++ b/browser/devtools/moz.build @@ -38,8 +38,6 @@ EXTRA_COMPONENTS += [ JAR_MANIFESTS += ['jar.mn'] -JS_MODULES_PATH = 'modules/devtools' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools += [ 'main.js', ] diff --git a/browser/devtools/netmonitor/moz.build b/browser/devtools/netmonitor/moz.build index 263d589c365..addaa6f8b1e 100644 --- a/browser/devtools/netmonitor/moz.build +++ b/browser/devtools/netmonitor/moz.build @@ -3,9 +3,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/netmonitor' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.netmonitor += [ 'panel.js' ] diff --git a/browser/devtools/profiler/moz.build b/browser/devtools/profiler/moz.build index 057cc9692b0..680371ee3e1 100644 --- a/browser/devtools/profiler/moz.build +++ b/browser/devtools/profiler/moz.build @@ -6,9 +6,7 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] -JS_MODULES_PATH = 'modules/devtools/profiler' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.profiler += [ 'cleopatra.js', 'commands.js', 'consts.js', diff --git a/browser/devtools/responsivedesign/moz.build b/browser/devtools/responsivedesign/moz.build index 487911b8334..af3d0737313 100644 --- a/browser/devtools/responsivedesign/moz.build +++ b/browser/devtools/responsivedesign/moz.build @@ -2,9 +2,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools += [ 'resize-commands.js' ] diff --git a/browser/devtools/scratchpad/moz.build b/browser/devtools/scratchpad/moz.build index 498b668bd79..62fc81c6f77 100644 --- a/browser/devtools/scratchpad/moz.build +++ b/browser/devtools/scratchpad/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/scratchpad' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.scratchpad += [ 'scratchpad-commands.js', 'scratchpad-panel.js' ] diff --git a/browser/devtools/shadereditor/moz.build b/browser/devtools/shadereditor/moz.build index 123f6525693..34121e10aa6 100644 --- a/browser/devtools/shadereditor/moz.build +++ b/browser/devtools/shadereditor/moz.build @@ -3,9 +3,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/shadereditor' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.shadereditor += [ 'panel.js' ] diff --git a/browser/devtools/sourceeditor/moz.build b/browser/devtools/sourceeditor/moz.build index 6e49065c277..67a53b40dce 100644 --- a/browser/devtools/sourceeditor/moz.build +++ b/browser/devtools/sourceeditor/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/sourceeditor' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.sourceeditor += [ 'autocomplete.js', 'css-autocompleter.js', 'css-tokenizer.js', diff --git a/browser/devtools/styleinspector/moz.build b/browser/devtools/styleinspector/moz.build index fb06feba37d..bf8611e8312 100644 --- a/browser/devtools/styleinspector/moz.build +++ b/browser/devtools/styleinspector/moz.build @@ -7,9 +7,7 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools/styleinspector' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.styleinspector += [ 'computed-view.js', 'css-parsing-utils.js', 'rule-view.js', diff --git a/browser/devtools/tilt/moz.build b/browser/devtools/tilt/moz.build index 3a04f7eac6c..32748facb6c 100644 --- a/browser/devtools/tilt/moz.build +++ b/browser/devtools/tilt/moz.build @@ -2,9 +2,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/tilt' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.tilt += [ 'tilt-commands.js', 'tilt-gl.js', 'tilt-math.js', diff --git a/browser/devtools/webaudioeditor/moz.build b/browser/devtools/webaudioeditor/moz.build index 8b3b90bee6d..7fbea6cc9bd 100644 --- a/browser/devtools/webaudioeditor/moz.build +++ b/browser/devtools/webaudioeditor/moz.build @@ -3,9 +3,7 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/webaudioeditor' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.webaudioeditor += [ 'panel.js' ] diff --git a/browser/devtools/webconsole/moz.build b/browser/devtools/webconsole/moz.build index 802ff7e11b7..6d42322e3fd 100644 --- a/browser/devtools/webconsole/moz.build +++ b/browser/devtools/webconsole/moz.build @@ -6,9 +6,7 @@ BROWSER_CHROME_MANIFESTS += ['test/browser.ini'] -JS_MODULES_PATH = 'modules/devtools/webconsole' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.webconsole += [ 'console-commands.js', 'console-output.js', 'hudservice.js', diff --git a/browser/devtools/webide/moz.build b/browser/devtools/webide/moz.build index 54103b07d8d..ae5e22e7154 100644 --- a/browser/devtools/webide/moz.build +++ b/browser/devtools/webide/moz.build @@ -12,9 +12,7 @@ DIRS += [ MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini'] -JS_MODULES_PATH = 'modules/devtools/webide' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.webide += [ 'modules/addons.js', 'modules/app-manager.js', 'modules/remote-resources.js', diff --git a/browser/experiments/moz.build b/browser/experiments/moz.build index 383e90fc1b0..2bd9f455da5 100644 --- a/browser/experiments/moz.build +++ b/browser/experiments/moz.build @@ -7,9 +7,7 @@ EXTRA_COMPONENTS += [ 'ExperimentsService.js', ] -JS_MODULES_PATH = 'modules/experiments' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.experiments += [ 'Experiments.jsm', ] diff --git a/dom/media/moz.build b/dom/media/moz.build index f40e1e69bc6..1e8ef0ee61e 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -46,9 +46,7 @@ EXTRA_COMPONENTS += [ 'PeerConnection.manifest', ] -JS_MODULES_PATH = 'modules/media' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.media += [ 'IdpProxy.jsm', 'PeerConnectionIdp.jsm', 'RTCStatsReport.jsm', diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py index dbb36b7c282..33c0f293fcd 100644 --- a/python/mozbuild/mozbuild/backend/recursivemake.py +++ b/python/mozbuild/mozbuild/backend/recursivemake.py @@ -951,8 +951,34 @@ class RecursiveMakeBackend(CommonBackend): backend_file.write('NO_DIST_INSTALL := 1\n') def _process_javascript_modules(self, obj, backend_file): - if obj.flavor != 'testing': - raise Exception('We only support testing JavaScriptModules instances.') + if obj.flavor not in ('extra', 'extra_pp', 'testing'): + raise Exception('Unsupported JavaScriptModules instance: %s' % obj.flavor) + + if obj.flavor == 'extra': + def onelement(element, namespace): + if not element.get_strings(): + return + + prefix = 'extra_js_%s' % namespace.replace('/', '_') + backend_file.write('%s_FILES := %s\n' + % (prefix, ' '.join(element.get_strings()))) + backend_file.write('%s_DEST = $(FINAL_TARGET)/%s\n' % (prefix, namespace)) + backend_file.write('INSTALL_TARGETS += %s\n\n' % prefix) + self._process_hierarchy_elements(obj, obj.modules, 'modules', onelement) + return + + if obj.flavor == 'extra_pp': + def onelement(element, namespace): + if not element.get_strings(): + return + + prefix = 'extra_pp_js_%s' % namespace.replace('/', '_') + backend_file.write('%s := %s\n' + % (prefix, ' '.join(element.get_strings()))) + backend_file.write('%s_PATH = $(FINAL_TARGET)/%s\n' % (prefix, namespace)) + backend_file.write('PP_TARGETS += %s\n\n' % prefix) + self._process_hierarchy_elements(obj, obj.modules, 'modules', onelement) + return if not self.environment.substs.get('ENABLE_TESTS', False): return diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py index 6c1a29ab5a9..7f32630c0a1 100644 --- a/python/mozbuild/mozbuild/frontend/emitter.py +++ b/python/mozbuild/mozbuild/frontend/emitter.py @@ -373,9 +373,7 @@ class TreeMetadataEmitter(LoggingMixin): 'EXTRA_COMPILE_FLAGS', 'EXTRA_COMPONENTS', 'EXTRA_DSO_LDOPTS', - 'EXTRA_JS_MODULES', 'EXTRA_PP_COMPONENTS', - 'EXTRA_PP_JS_MODULES', 'FAIL_ON_WARNINGS', 'FILES_PER_UNIFIED_FILE', 'USE_STATIC_LIBS', @@ -507,6 +505,14 @@ class TreeMetadataEmitter(LoggingMixin): 'HOST_USE_LIBS' if kind == 'HOST_SIMPLE_PROGRAMS' else 'USE_LIBS')) + extra_js_modules = sandbox.get('EXTRA_JS_MODULES') + if extra_js_modules: + yield JavaScriptModules(sandbox, extra_js_modules, 'extra') + + extra_pp_js_modules = sandbox.get('EXTRA_PP_JS_MODULES') + if extra_pp_js_modules: + yield JavaScriptModules(sandbox, extra_pp_js_modules, 'extra_pp') + test_js_modules = sandbox.get('TESTING_JS_MODULES') if test_js_modules: yield JavaScriptModules(sandbox, test_js_modules, 'testing') diff --git a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py index 3c367687c87..abb059a9fb4 100644 --- a/python/mozbuild/mozbuild/frontend/sandbox_symbols.py +++ b/python/mozbuild/mozbuild/frontend/sandbox_symbols.py @@ -186,7 +186,7 @@ VARIABLES = { ``$(FINAL_TARGET)/components/``. """, 'libs'), - 'EXTRA_JS_MODULES': (StrictOrderingOnAppendList, list, + 'EXTRA_JS_MODULES': (HierarchicalStringList, list, """Additional JavaScript files to distribute. This variable contains a list of files to copy into @@ -194,7 +194,7 @@ VARIABLES = { to ``modules`` if left undefined. """, 'libs'), - 'EXTRA_PP_JS_MODULES': (StrictOrderingOnAppendList, list, + 'EXTRA_PP_JS_MODULES': (HierarchicalStringList, list, """Additional JavaScript files to distribute. This variable contains a list of files to copy into diff --git a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build index 076db088f35..1d240be8d63 100644 --- a/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build +++ b/python/mozbuild/mozbuild/test/backend/data/variable_passthru/moz.build @@ -7,9 +7,6 @@ SOURCES += ['bar.s', 'foo.asm'] EXTRA_COMPONENTS = ['bar.js', 'foo.js'] EXTRA_PP_COMPONENTS = ['bar.pp.js', 'foo.pp.js'] -EXTRA_JS_MODULES += ['bar.jsm', 'foo.jsm'] -EXTRA_PP_JS_MODULES = ['bar.pp.jsm', 'foo.pp.jsm'] - HOST_SOURCES += ['bar.cpp', 'foo.cpp'] HOST_SOURCES += ['bar.c', 'foo.c'] diff --git a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py index 30cc917c079..35325bcf0c6 100644 --- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py +++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py @@ -276,14 +276,6 @@ class TestRecursiveMakeBackend(BackendTester): 'EXTRA_PP_COMPONENTS += bar.pp.js', 'EXTRA_PP_COMPONENTS += foo.pp.js', ], - 'EXTRA_JS_MODULES': [ - 'EXTRA_JS_MODULES += bar.jsm', - 'EXTRA_JS_MODULES += foo.jsm', - ], - 'EXTRA_PP_JS_MODULES': [ - 'EXTRA_PP_JS_MODULES += bar.pp.jsm', - 'EXTRA_PP_JS_MODULES += foo.pp.jsm', - ], 'FAIL_ON_WARNINGS': [ 'FAIL_ON_WARNINGS := 1', ], diff --git a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build index 4e8d9002416..eb64a96f54f 100644 --- a/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build +++ b/python/mozbuild/mozbuild/test/frontend/data/variable-passthru/moz.build @@ -7,9 +7,6 @@ SOURCES += ['fans.asm', 'tans.s'] EXTRA_COMPONENTS=['fans.js', 'tans.js'] EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'] -EXTRA_JS_MODULES += ['bar.jsm', 'foo.jsm'] -EXTRA_PP_JS_MODULES = ['bar.pp.jsm', 'foo.pp.jsm'] - HOST_SOURCES += ['fans.cpp', 'tans.cpp'] HOST_SOURCES += ['fans.c', 'tans.c'] diff --git a/python/mozbuild/mozbuild/test/frontend/test_emitter.py b/python/mozbuild/mozbuild/test/frontend/test_emitter.py index ba8e9097899..c548d75fe6b 100644 --- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py +++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py @@ -154,8 +154,6 @@ class TestEmitterBasic(unittest.TestCase): DISABLE_STL_WRAPPING=True, EXTRA_COMPONENTS=['fans.js', 'tans.js'], EXTRA_PP_COMPONENTS=['fans.pp.js', 'tans.pp.js'], - EXTRA_JS_MODULES=['bar.jsm', 'foo.jsm'], - EXTRA_PP_JS_MODULES=['bar.pp.jsm', 'foo.pp.jsm'], FAIL_ON_WARNINGS=True, HOST_CPPSRCS=['fans.cpp', 'tans.cpp'], HOST_CSRCS=['fans.c', 'tans.c'], diff --git a/services/metrics/moz.build b/services/metrics/moz.build index fdc2eea308b..c498ad13f74 100644 --- a/services/metrics/moz.build +++ b/services/metrics/moz.build @@ -6,14 +6,12 @@ TEST_DIRS += ['tests'] -EXTRA_PP_JS_MODULES += [ +EXTRA_PP_JS_MODULES.services.metrics += [ 'dataprovider.jsm', 'providermanager.jsm', 'storage.jsm', ] -JS_MODULES_PATH = 'modules/services/metrics' - TESTING_JS_MODULES.services.metrics += [ 'modules-testing/mocks.jsm', ] diff --git a/toolkit/components/osfile/modules/moz.build b/toolkit/components/osfile/modules/moz.build index 5371835e11f..1d32c4e837d 100644 --- a/toolkit/components/osfile/modules/moz.build +++ b/toolkit/components/osfile/modules/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/osfile' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.osfile += [ 'osfile_async_front.jsm', 'osfile_async_worker.js', 'osfile_native.jsm', diff --git a/toolkit/components/promiseworker/worker/moz.build b/toolkit/components/promiseworker/worker/moz.build index d2d37b19223..82c7b779506 100644 --- a/toolkit/components/promiseworker/worker/moz.build +++ b/toolkit/components/promiseworker/worker/moz.build @@ -4,8 +4,6 @@ # 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/. -JS_MODULES_PATH = 'modules/workers' - -EXTRA_JS_MODULES = [ +EXTRA_JS_MODULES.workers = [ 'PromiseWorker.js', ] diff --git a/toolkit/components/sqlite/moz.build b/toolkit/components/sqlite/moz.build index d9d295f2de0..857e662a562 100644 --- a/toolkit/components/sqlite/moz.build +++ b/toolkit/components/sqlite/moz.build @@ -6,8 +6,6 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini'] -JS_MODULES_PATH = 'modules/sqlite' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.sqlite += [ 'sqlite_internal.js', ] diff --git a/toolkit/components/workerloader/moz.build b/toolkit/components/workerloader/moz.build index e3a586181b4..c0a92d54bf6 100644 --- a/toolkit/components/workerloader/moz.build +++ b/toolkit/components/workerloader/moz.build @@ -6,8 +6,6 @@ MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini'] -JS_MODULES_PATH = 'modules/workers' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.workers += [ 'require.js' ] diff --git a/toolkit/components/workerlz4/moz.build b/toolkit/components/workerlz4/moz.build index 1adfbbf037b..1a4d3d62d8b 100644 --- a/toolkit/components/workerlz4/moz.build +++ b/toolkit/components/workerlz4/moz.build @@ -6,9 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini'] -JS_MODULES_PATH = 'modules/workers' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.workers += [ 'lz4.js', 'lz4_internal.js', ] diff --git a/toolkit/crashreporter/test/Makefile.in b/toolkit/crashreporter/test/Makefile.in index 365bbaa2515..b1b03e56fc7 100644 --- a/toolkit/crashreporter/test/Makefile.in +++ b/toolkit/crashreporter/test/Makefile.in @@ -5,7 +5,7 @@ EXTRA_LIBS += $(NSPR_LIBS) -UNIT_FILES = $(SHARED_LIBRARY) $(EXTRA_JS_MODULES) +UNIT_FILES = $(SHARED_LIBRARY) CrashTestUtils.jsm UNIT_DEST = $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/ INSTALL_TARGETS += UNIT diff --git a/toolkit/devtools/acorn/moz.build b/toolkit/devtools/acorn/moz.build index d66da8cda32..88579e957fb 100644 --- a/toolkit/devtools/acorn/moz.build +++ b/toolkit/devtools/acorn/moz.build @@ -6,9 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools/acorn' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.acorn += [ 'acorn.js', 'acorn_loose.js', 'walk.js', diff --git a/toolkit/devtools/apps/moz.build b/toolkit/devtools/apps/moz.build index a5cb7743637..e0103ca4338 100644 --- a/toolkit/devtools/apps/moz.build +++ b/toolkit/devtools/apps/moz.build @@ -5,9 +5,7 @@ TEST_DIRS += ['tests'] -JS_MODULES_PATH = 'modules/devtools' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools += [ 'app-actor-front.js', 'Devices.jsm', 'Simulator.jsm' diff --git a/toolkit/devtools/discovery/moz.build b/toolkit/devtools/discovery/moz.build index 47dbc1e5603..2e4673c2a3f 100644 --- a/toolkit/devtools/discovery/moz.build +++ b/toolkit/devtools/discovery/moz.build @@ -6,8 +6,6 @@ TEST_DIRS += ['tests'] -JS_MODULES_PATH = 'modules/devtools/discovery' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.discovery += [ 'discovery.js', ] diff --git a/toolkit/devtools/jsbeautify/moz.build b/toolkit/devtools/jsbeautify/moz.build index 23cf8c785cb..03a41d88699 100644 --- a/toolkit/devtools/jsbeautify/moz.build +++ b/toolkit/devtools/jsbeautify/moz.build @@ -6,9 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools/jsbeautify' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.jsbeautify += [ 'beautify.js', 'lib/sanitytest.js', 'lib/urlencode_unpacker.js', diff --git a/toolkit/devtools/pretty-fast/moz.build b/toolkit/devtools/pretty-fast/moz.build index 1190adac810..6e3bf0eab59 100644 --- a/toolkit/devtools/pretty-fast/moz.build +++ b/toolkit/devtools/pretty-fast/moz.build @@ -6,8 +6,6 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools += [ 'pretty-fast.js', ] diff --git a/toolkit/devtools/qrcode/decoder/moz.build b/toolkit/devtools/qrcode/decoder/moz.build index b2ee500b8e1..9199a72a405 100644 --- a/toolkit/devtools/qrcode/decoder/moz.build +++ b/toolkit/devtools/qrcode/decoder/moz.build @@ -4,8 +4,6 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/qrcode/decoder' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.qrcode.decoder += [ 'index.js', ] diff --git a/toolkit/devtools/qrcode/encoder/moz.build b/toolkit/devtools/qrcode/encoder/moz.build index c1822f4a451..24985089930 100644 --- a/toolkit/devtools/qrcode/encoder/moz.build +++ b/toolkit/devtools/qrcode/encoder/moz.build @@ -4,8 +4,6 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/qrcode/encoder' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.qrcode.encoder += [ 'index.js', ] diff --git a/toolkit/devtools/qrcode/moz.build b/toolkit/devtools/qrcode/moz.build index 7651e14c09f..94f42e815a4 100644 --- a/toolkit/devtools/qrcode/moz.build +++ b/toolkit/devtools/qrcode/moz.build @@ -9,9 +9,7 @@ DIRS += [ 'encoder' ] -JS_MODULES_PATH = 'modules/devtools/qrcode' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.qrcode += [ 'index.js', ] diff --git a/toolkit/devtools/styleinspector/moz.build b/toolkit/devtools/styleinspector/moz.build index 90ba481f4bd..9edb32500fd 100644 --- a/toolkit/devtools/styleinspector/moz.build +++ b/toolkit/devtools/styleinspector/moz.build @@ -4,8 +4,6 @@ # 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/. -JS_MODULES_PATH = 'modules/devtools/styleinspector' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.styleinspector += [ 'css-logic.js' ] diff --git a/toolkit/devtools/tern/moz.build b/toolkit/devtools/tern/moz.build index a34b973b72e..a88f084b59f 100644 --- a/toolkit/devtools/tern/moz.build +++ b/toolkit/devtools/tern/moz.build @@ -6,9 +6,7 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools/tern' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.tern += [ 'browser.js', 'comment.js', 'condense.js', diff --git a/toolkit/devtools/transport/moz.build b/toolkit/devtools/transport/moz.build index 950bf3cd270..5e47bc064bc 100644 --- a/toolkit/devtools/transport/moz.build +++ b/toolkit/devtools/transport/moz.build @@ -6,9 +6,7 @@ TEST_DIRS += ['tests'] -JS_MODULES_PATH = 'modules/devtools/transport' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.transport += [ 'packets.js', 'stream-utils.js', 'transport.js' diff --git a/toolkit/devtools/webconsole/moz.build b/toolkit/devtools/webconsole/moz.build index 6675d2471b5..621a69399b2 100644 --- a/toolkit/devtools/webconsole/moz.build +++ b/toolkit/devtools/webconsole/moz.build @@ -8,9 +8,7 @@ if CONFIG['OS_TARGET'] != 'Android': MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini'] XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini'] -JS_MODULES_PATH = 'modules/devtools/toolkit/webconsole' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.devtools.toolkit.webconsole += [ 'client.js', 'network-helper.js', 'network-monitor.js', diff --git a/toolkit/identity/moz.build b/toolkit/identity/moz.build index e35bb95fc62..916a3d013e5 100644 --- a/toolkit/identity/moz.build +++ b/toolkit/identity/moz.build @@ -17,9 +17,7 @@ SOURCES += [ 'IdentityCryptoService.cpp', ] -JS_MODULES_PATH = 'modules/identity' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.identity += [ 'Identity.jsm', 'IdentityProvider.jsm', 'IdentityStore.jsm', @@ -31,7 +29,7 @@ EXTRA_JS_MODULES += [ 'Sandbox.jsm', ] -EXTRA_PP_JS_MODULES += [ +EXTRA_PP_JS_MODULES.identity += [ 'FirefoxAccounts.jsm', ] diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build index 240bc2c7446..9fbc80486bb 100644 --- a/toolkit/mozapps/extensions/internal/moz.build +++ b/toolkit/mozapps/extensions/internal/moz.build @@ -4,9 +4,7 @@ # 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/. -JS_MODULES_PATH = 'modules/addons' - -EXTRA_JS_MODULES += [ +EXTRA_JS_MODULES.addons += [ 'AddonLogging.jsm', 'AddonRepository.jsm', 'AddonRepository_SQLiteMigrator.jsm', @@ -18,7 +16,7 @@ EXTRA_JS_MODULES += [ 'SpellCheckDictionaryBootstrap.js', ] -EXTRA_PP_JS_MODULES += [ +EXTRA_PP_JS_MODULES.addons += [ 'XPIProvider.jsm', 'XPIProviderUtils.js', ]