From f2849470f8734816d24b6d1493ded327db6fa863 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Mon, 2 Nov 2015 08:18:58 -0800 Subject: [PATCH] Bug 1219723 - Package gcli with the same layout than in the source tree. r=jryans --- devtools/shared/Loader.jsm | 4 +- devtools/shared/gcli/gcli.jsm | 24 ---- devtools/shared/gcli/moz.build | 113 ++---------------- .../gcli/source/lib/gcli/commands/moz.build | 21 ++++ .../gcli/source/lib/gcli/connectors/moz.build | 9 ++ .../gcli/source/lib/gcli/converters/moz.build | 12 ++ .../gcli/source/lib/gcli/fields/moz.build | 11 ++ .../gcli/source/lib/gcli/languages/moz.build | 12 ++ .../shared/gcli/source/lib/gcli/moz.build | 13 ++ .../gcli/source/lib/gcli/mozui/moz.build | 11 ++ .../gcli/source/lib/gcli/types/moz.build | 25 ++++ .../shared/gcli/source/lib/gcli/ui/moz.build | 15 +++ .../gcli/source/lib/gcli/util/moz.build | 17 +++ .../tests/mochitest/test_loader_paths.html | 4 +- 14 files changed, 162 insertions(+), 129 deletions(-) delete mode 100644 devtools/shared/gcli/gcli.jsm create mode 100644 devtools/shared/gcli/source/lib/gcli/commands/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/connectors/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/converters/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/fields/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/languages/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/mozui/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/types/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/ui/moz.build create mode 100644 devtools/shared/gcli/source/lib/gcli/util/moz.build diff --git a/devtools/shared/Loader.jsm b/devtools/shared/Loader.jsm index 76772afbb42..b6a8cfc9c18 100644 --- a/devtools/shared/Loader.jsm +++ b/devtools/shared/Loader.jsm @@ -87,9 +87,7 @@ BuiltinProvider.prototype = { // ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠ "devtools": "resource://devtools", // ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠ - "devtools/client": "resource://devtools/client", - // ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠ - "gcli": "resource://devtools/gcli", + "gcli": "resource://devtools/shared/gcli/source/lib/gcli", // ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠ "promise": "resource://gre/modules/Promise-backend.js", // ⚠ DISCUSSION ON DEV-DEVELOPER-TOOLS REQUIRED BEFORE MODIFYING ⚠ diff --git a/devtools/shared/gcli/gcli.jsm b/devtools/shared/gcli/gcli.jsm deleted file mode 100644 index c410441cac0..00000000000 --- a/devtools/shared/gcli/gcli.jsm +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2012, Mozilla Foundation and contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -"use strict"; - -this.EXPORTED_SYMBOLS = [ "gcli", "Requisition" ]; - -var {require} = Components.utils.import("resource://devtools/shared/Loader.jsm", {}); - -this.gcli = require('gcli/index'); -this.Requisition = require('gcli/cli').Requisition; diff --git a/devtools/shared/gcli/moz.build b/devtools/shared/gcli/moz.build index 11ee1715f98..9ba08000c25 100644 --- a/devtools/shared/gcli/moz.build +++ b/devtools/shared/gcli/moz.build @@ -6,105 +6,18 @@ DIRS += [ 'commands', + 'source/lib/gcli', + 'source/lib/gcli/connectors', + 'source/lib/gcli/converters', + 'source/lib/gcli/commands', + 'source/lib/gcli/fields', + 'source/lib/gcli/languages', + 'source/lib/gcli/mozui', + 'source/lib/gcli/types', + 'source/lib/gcli/ui', + 'source/lib/gcli/util', ] -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.commands += [ - 'source/lib/gcli/commands/clear.js', - 'source/lib/gcli/commands/commands.js', - 'source/lib/gcli/commands/connect.js', - 'source/lib/gcli/commands/context.js', - 'source/lib/gcli/commands/exec.js', - 'source/lib/gcli/commands/global.js', - 'source/lib/gcli/commands/help.js', - 'source/lib/gcli/commands/intro.js', - 'source/lib/gcli/commands/lang.js', - 'source/lib/gcli/commands/mocks.js', - 'source/lib/gcli/commands/pref.js', - 'source/lib/gcli/commands/preflist.js', - 'source/lib/gcli/commands/test.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.connectors += [ - 'source/lib/gcli/connectors/connectors.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.converters += [ - 'source/lib/gcli/converters/basic.js', - 'source/lib/gcli/converters/converters.js', - 'source/lib/gcli/converters/html.js', - 'source/lib/gcli/converters/terminal.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.fields += [ - 'source/lib/gcli/fields/delegate.js', - 'source/lib/gcli/fields/fields.js', - 'source/lib/gcli/fields/selection.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.languages += [ - 'source/lib/gcli/languages/command.html', - 'source/lib/gcli/languages/command.js', - 'source/lib/gcli/languages/javascript.js', - 'source/lib/gcli/languages/languages.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.mozui += [ - 'source/lib/gcli/mozui/completer.js', - 'source/lib/gcli/mozui/inputter.js', - 'source/lib/gcli/mozui/tooltip.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.types += [ - 'source/lib/gcli/types/array.js', - 'source/lib/gcli/types/boolean.js', - 'source/lib/gcli/types/command.js', - 'source/lib/gcli/types/date.js', - 'source/lib/gcli/types/delegate.js', - 'source/lib/gcli/types/file.js', - 'source/lib/gcli/types/fileparser.js', - 'source/lib/gcli/types/javascript.js', - 'source/lib/gcli/types/node.js', - 'source/lib/gcli/types/number.js', - 'source/lib/gcli/types/resource.js', - 'source/lib/gcli/types/selection.js', - 'source/lib/gcli/types/setting.js', - 'source/lib/gcli/types/string.js', - 'source/lib/gcli/types/types.js', - 'source/lib/gcli/types/union.js', - 'source/lib/gcli/types/url.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.ui += [ - 'source/lib/gcli/ui/focus.js', - 'source/lib/gcli/ui/history.js', - 'source/lib/gcli/ui/intro.js', - 'source/lib/gcli/ui/menu.css', - 'source/lib/gcli/ui/menu.html', - 'source/lib/gcli/ui/menu.js', - 'source/lib/gcli/ui/view.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli.util += [ - 'source/lib/gcli/util/domtemplate.js', - 'source/lib/gcli/util/fileparser.js', - 'source/lib/gcli/util/filesystem.js', - 'source/lib/gcli/util/host.js', - 'source/lib/gcli/util/l10n.js', - 'source/lib/gcli/util/legacy.js', - 'source/lib/gcli/util/prism.js', - 'source/lib/gcli/util/spell.js', - 'source/lib/gcli/util/util.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.gcli += [ - 'source/lib/gcli/cli.js', - 'source/lib/gcli/index.js', - 'source/lib/gcli/l10n.js', - 'source/lib/gcli/settings.js', - 'source/lib/gcli/system.js', -] - -FINAL_TARGET_FILES.chrome.devtools.modules.devtools.shared.gcli += [ - 'gcli.jsm', - 'Templater.jsm', -] +DevToolsModules( + 'Templater.jsm' +) diff --git a/devtools/shared/gcli/source/lib/gcli/commands/moz.build b/devtools/shared/gcli/source/lib/gcli/commands/moz.build new file mode 100644 index 00000000000..027116f4648 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/commands/moz.build @@ -0,0 +1,21 @@ +# -*- 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/. + +DevToolsModules( + 'clear.js', + 'commands.js', + 'connect.js', + 'context.js', + 'exec.js', + 'global.js', + 'help.js', + 'intro.js', + 'lang.js', + 'mocks.js', + 'pref.js', + 'preflist.js', + 'test.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/connectors/moz.build b/devtools/shared/gcli/source/lib/gcli/connectors/moz.build new file mode 100644 index 00000000000..c64d0725630 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/connectors/moz.build @@ -0,0 +1,9 @@ +# -*- 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/. + +DevToolsModules( + 'connectors.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/converters/moz.build b/devtools/shared/gcli/source/lib/gcli/converters/moz.build new file mode 100644 index 00000000000..11aeb7fdfc8 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/converters/moz.build @@ -0,0 +1,12 @@ +# -*- 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/. + +DevToolsModules( + 'basic.js', + 'converters.js', + 'html.js', + 'terminal.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/fields/moz.build b/devtools/shared/gcli/source/lib/gcli/fields/moz.build new file mode 100644 index 00000000000..682dc0b559a --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/fields/moz.build @@ -0,0 +1,11 @@ +# -*- 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/. + +DevToolsModules( + 'delegate.js', + 'fields.js', + 'selection.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/languages/moz.build b/devtools/shared/gcli/source/lib/gcli/languages/moz.build new file mode 100644 index 00000000000..55083f6d3f4 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/languages/moz.build @@ -0,0 +1,12 @@ +# -*- 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/. + +DevToolsModules( + 'command.html', + 'command.js', + 'javascript.js', + 'languages.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/moz.build b/devtools/shared/gcli/source/lib/gcli/moz.build new file mode 100644 index 00000000000..41034322c57 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/moz.build @@ -0,0 +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/. + +DevToolsModules( + 'cli.js', + 'index.js', + 'l10n.js', + 'settings.js', + 'system.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/mozui/moz.build b/devtools/shared/gcli/source/lib/gcli/mozui/moz.build new file mode 100644 index 00000000000..90a8ca02eec --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/mozui/moz.build @@ -0,0 +1,11 @@ +# -*- 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/. + +DevToolsModules( + 'completer.js', + 'inputter.js', + 'tooltip.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/types/moz.build b/devtools/shared/gcli/source/lib/gcli/types/moz.build new file mode 100644 index 00000000000..6c4053d9b17 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/types/moz.build @@ -0,0 +1,25 @@ +# -*- 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/. + +DevToolsModules( + 'array.js', + 'boolean.js', + 'command.js', + 'date.js', + 'delegate.js', + 'file.js', + 'fileparser.js', + 'javascript.js', + 'node.js', + 'number.js', + 'resource.js', + 'selection.js', + 'setting.js', + 'string.js', + 'types.js', + 'union.js', + 'url.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/ui/moz.build b/devtools/shared/gcli/source/lib/gcli/ui/moz.build new file mode 100644 index 00000000000..a118bfaa0c8 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/ui/moz.build @@ -0,0 +1,15 @@ +# -*- 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/. + +DevToolsModules( + 'focus.js', + 'history.js', + 'intro.js', + 'menu.css', + 'menu.html', + 'menu.js', + 'view.js', +) diff --git a/devtools/shared/gcli/source/lib/gcli/util/moz.build b/devtools/shared/gcli/source/lib/gcli/util/moz.build new file mode 100644 index 00000000000..2b9e7ad12f0 --- /dev/null +++ b/devtools/shared/gcli/source/lib/gcli/util/moz.build @@ -0,0 +1,17 @@ +# -*- 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/. + +DevToolsModules( + 'domtemplate.js', + 'fileparser.js', + 'filesystem.js', + 'host.js', + 'l10n.js', + 'legacy.js', + 'prism.js', + 'spell.js', + 'util.js', +) diff --git a/devtools/shared/tests/mochitest/test_loader_paths.html b/devtools/shared/tests/mochitest/test_loader_paths.html index 3f418a6ca3e..0a3d1e69ce3 100644 --- a/devtools/shared/tests/mochitest/test_loader_paths.html +++ b/devtools/shared/tests/mochitest/test_loader_paths.html @@ -43,8 +43,8 @@ srcdir.load(); is(builtin.loader.mapping.length, - srcdir.loader.mapping.length + 2, - "The built-in loader has 2 additional mappings."); + srcdir.loader.mapping.length + 1, + "The built-in loader has one additional mappings."); Services.prefs.clearUserPref(SRCDIR_PREF);