Bug 1660557 - stop using js_modules to pack builtin and default themes, r=glandium,zombie

This is ultimately less build magic and makes for more meaningful URIs.

Differential Revision: https://phabricator.services.mozilla.com/D89130
This commit is contained in:
Gijs Kruitbosch 2020-09-08 12:47:22 +00:00
Родитель 9fad06329d
Коммит 72fabd3f3f
11 изменённых файлов: 31 добавлений и 48 удалений

Просмотреть файл

@ -391,9 +391,10 @@ function parseManifest(manifestUri) {
});
}
// If the given URI is a webextension manifest, extract the scripts
// for any embedded APIs. Returns the passed in URI if the manifest
// is not a webextension manifest, null otherwise.
// If the given URI is a webextension manifest, extract files used by
// any of its APIs (scripts, icons, style sheets, theme images).
// Returns the passed in URI if the manifest is not a webextension
// manifest, null otherwise.
async function parseJsonManifest(uri) {
uri = Services.io.newURI(convertToCodeURI(uri.spec));

Просмотреть файл

@ -1354,17 +1354,17 @@ BrowserGlue.prototype = {
AddonManager.maybeInstallBuiltinAddon(
"firefox-compact-light@mozilla.org",
"1.0",
"resource:///modules/themes/light/"
"resource://builtin-themes/light/"
);
AddonManager.maybeInstallBuiltinAddon(
"firefox-compact-dark@mozilla.org",
"1.0",
"resource:///modules/themes/dark/"
"resource://builtin-themes/dark/"
);
AddonManager.maybeInstallBuiltinAddon(
"firefox-alpenglow@mozilla.org",
"1.0",
"resource:///modules/themes/alpenglow/"
"resource://builtin-themes/alpenglow/"
);
if (AppConstants.MOZ_NORMANDY) {

Просмотреть файл

@ -1,11 +0,0 @@
# -*- Mode: python; 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/.
FINAL_TARGET_FILES.modules['themes']['alpenglow'] += [
'*.svg',
'manifest.json',
]

Просмотреть файл

@ -1,11 +0,0 @@
# -*- Mode: python; 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/.
EXTRA_JS_MODULES.themes['dark'] += [
'experiment.css',
'icon.svg',
'manifest.json',
]

Просмотреть файл

@ -0,0 +1,17 @@
# 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/.
browser.jar:
% resource builtin-themes %content/builtin-themes/
content/builtin-themes/alpenglow (alpenglow/*.svg)
content/builtin-themes/alpenglow/manifest.json (alpenglow/manifest.json)
content/builtin-themes/dark (dark/*.svg)
content/builtin-themes/dark (dark/*.css)
content/builtin-themes/dark/manifest.json (dark/manifest.json)
content/builtin-themes/light (light/*.svg)
content/builtin-themes/light (light/*.css)
content/builtin-themes/light/manifest.json (light/manifest.json)

Просмотреть файл

@ -1,11 +0,0 @@
# -*- Mode: python; 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/.
EXTRA_JS_MODULES.themes['light'] += [
'experiment.css',
'icon.svg',
'manifest.json',
]

Просмотреть файл

@ -4,7 +4,4 @@
# 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.themes['default'] += [
'icon.svg',
'manifest.json',
]
JAR_MANIFESTS += ['jar.mn']

Просмотреть файл

@ -17,9 +17,7 @@ else:
DIRS += ['windows']
DIRS += [
'addons/alpenglow',
'addons/dark',
'addons/light',
'addons',
]
with Files('osx/**'):

Просмотреть файл

@ -2461,7 +2461,7 @@ var XPIProvider = {
this.maybeInstallBuiltinAddon(
"default-theme@mozilla.org",
"1.0",
"resource://gre/modules/themes/default/"
"resource://default-theme/"
);
resolveProviderReady(Promise.all(this.startupPromises));

Просмотреть файл

@ -33,4 +33,8 @@ toolkit.jar:
content/mozapps/extensions/rating-star.css (content/rating-star.css)
content/mozapps/extensions/shortcuts.css (content/shortcuts.css)
content/mozapps/extensions/shortcuts.js (content/shortcuts.js)
% resource default-theme %content/mozapps/extensions/default-theme/
content/mozapps/extensions/default-theme/icon.svg (default-theme/icon.svg)
content/mozapps/extensions/default-theme/manifest.json (default-theme/manifest.json)
#endif

Просмотреть файл

@ -16,7 +16,6 @@ if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
DEFINES['MOZ_FENNEC'] = True
DIRS += [
'default-theme',
'internal',
]
TEST_DIRS += ['test']