Bug 1431260 - Switch multilocale.json to multilocale.txt in the build system. r?gps
MozReview-Commit-ID: 6S4VaAvDako
--- a/browser/installer/allowed-dupes.mn
+++ b/browser/installer/allowed-dupes.mn
@@ -140,11 +140,13 @@ modules/commonjs/sdk/ui/button/view/even
modules/commonjs/sdk/ui/state/events.js
plugin-container.app/Contents/PkgInfo
res/table-remove-column-active.gif
res/table-remove-column-hover.gif
res/table-remove-column.gif
res/table-remove-row-active.gif
res/table-remove-row-hover.gif
res/table-remove-row.gif
+res/multilocale.txt
+update.locale
# Aurora branding
browser/chrome/browser/content/branding/icon64.png
browser/chrome/devtools/content/framework/dev-edition-promo/dev-edition-logo.png
--- a/browser/locales/Makefile.in
+++ b/browser/locales/Makefile.in
@@ -81,17 +81,17 @@ ifndef RELEASE_OR_BETA
endif
ifneq '$(or $(MOZ_DEV_EDITION),$(NIGHTLY_BUILD))' ''
@$(MAKE) -C ../extensions/webcompat-reporter/locales AB_CD=$* XPI_NAME=locale-$*
endif
@$(MAKE) -C ../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -C ../../devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
- @$(MAKE) multilocale.json-$* AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) multilocale.txt-$* AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
chrome-%: AB_CD=$*
chrome-%: IS_LANGUAGE_REPACK=1
chrome-%:
$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
@$(MAKE) -C ../../toolkit/locales chrome-$*
@$(MAKE) -C ../../services/sync/locales chrome AB_CD=$*
--- a/mobile/android/installer/allowed-dupes.mn
+++ b/mobile/android/installer/allowed-dupes.mn
@@ -41,10 +41,12 @@ modules/devtools/shared/Console.jsm
modules/devtools/shared/Loader.jsm
modules/devtools/shared/apps/Simulator.jsm
res/table-remove-column-active.gif
res/table-remove-column-hover.gif
res/table-remove-column.gif
res/table-remove-row-active.gif
res/table-remove-row-hover.gif
res/table-remove-row.gif
+res/multilocale.txt
modules/commonjs/index.js
chrome/toolkit/content/global/XPCNativeWrapper.js
+update.locale
--- a/mobile/android/locales/Makefile.in
+++ b/mobile/android/locales/Makefile.in
@@ -39,17 +39,17 @@ clobber-stage:
# merge if we're not en-US, using conditional function as we need
# the current value of AB_CD
libs-%: AB_CD=$*
libs-%:
$(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
@$(MAKE) -C $(DEPTH)/mobile/locales libs-$*
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
- @$(MAKE) multilocale.json-$* AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) multilocale.txt-$* AB_CD=$* XPI_NAME=locale-$*
ifeq ($(OS_TARGET),Android)
@$(MAKE) -C $(DEPTH)/mobile/android/base/locales AB_CD=$* XPI_NAME=locale-$*
endif
# Tailored target to just add the chrome processing for multi-locale builds
# merge if we're not en-US, using conditional function as we need
# the current value of AB_CD
chrome-%: AB_CD=$*
--- a/toolkit/locales/gen_multilocale.py
+++ b/toolkit/locales/gen_multilocale.py
@@ -1,21 +1,19 @@
# 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/.
from __future__ import print_function, unicode_literals
-import json
import sys
def main(output, *locales):
locales = list(locales)
if "en-US" not in locales:
locales.append("en-US")
- json.dump({
- "locales": locales
- }, output)
+
+ print(",".join(locales), file=output)
if __name__ == '__main__':
main(sys.stdout, *sys.argv[1:])
--- a/toolkit/locales/moz.build
+++ b/toolkit/locales/moz.build
@@ -11,22 +11,22 @@ if CONFIG['MOZ_BUILD_APP'] == 'mobile/an
DEFINES['MOZ_FENNEC'] = True
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
DEFINES['MOZ_GTK'] = True
JAR_MANIFESTS += ['jar.mn']
GENERATED_FILES = [
- 'multilocale.json',
+ 'multilocale.txt',
]
-multilocale = GENERATED_FILES['multilocale.json']
+multilocale = GENERATED_FILES['multilocale.txt']
multilocale.script = 'gen_multilocale.py'
FINAL_TARGET_FILES.res += [
- '!multilocale.json',
+ '!multilocale.txt',
]
if CONFIG['MOZ_CRASHREPORTER']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
# TODO: fixing bug 1223748 should let us remove this special case
LOCALIZED_FILES['crashreporter.app'].Contents.Resources += [
'en-US/crashreporter/crashreporter.ini'
]
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -19,17 +19,17 @@ NON_CHROME = set([
'dictionaries',
'defaults/profile',
'defaults/pref*/*-l10n.js',
'update.locale',
'updater.ini',
'extensions/langpack-*@*',
'distribution/extensions/langpack-*@*',
'chrome/**/searchplugins/*.xml',
- '**/multilocale.json'
+ '**/multilocale.txt'
])
def valid_extra_l10n(arg):
if '=' not in arg:
raise ValueError('Invalid value')
return tuple(arg.split('=', 1))
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -27,17 +27,17 @@ ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD
$(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(DEPTH)/installer-stage && true
endif
export USE_ELF_HACK ELF_HACK_FLAGS
# Override the value of OMNIJAR_NAME from config.status with the value
# set earlier in this file.
-stage-package: multilocale.json locale-manifest.in $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
+stage-package: multilocale.txt locale-manifest.in $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
OMNIJAR_NAME=$(OMNIJAR_NAME) \
NO_PKG_FILES="$(NO_PKG_FILES)" \
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.py $(DEFINES) $(ACDEFINES) \
--format $(MOZ_PACKAGER_FORMAT) \
$(addprefix --removals ,$(MOZ_PKG_REMOVALS)) \
$(if $(filter-out 0,$(MOZ_PKG_FATAL_WARNINGS)),,--ignore-errors) \
$(if $(MOZ_PACKAGER_MINIFY),--minify) \
$(if $(MOZ_PACKAGER_MINIFY_JS),--minify-js \
@@ -199,33 +199,33 @@ ALL_LOCALES = $(if $(filter en-US,$(LOCA
ifeq ($(MOZ_BUILD_APP),mobile/android)
BASE_PATH:=@BINPATH@
MULTILOCALE_DIR = $(DIST)/$(BINPATH)/res
else
BASE_PATH:=@RESPATH@
MULTILOCALE_DIR = $(DIST)/$(RESPATH)/res
endif
-# This version of the target uses MOZ_CHROME_MULTILOCALE to build multilocale.json
+# This version of the target uses MOZ_CHROME_MULTILOCALE to build multilocale.txt
# and places it in dist/bin/res - it should be used when packaging a build.
-multilocale.json: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
-multilocale.json:
- $(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.json' $(MDDEPDIR)/multilocale.json.pp $(ALL_LOCALES))
+multilocale.txt: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
+multilocale.txt:
+ $(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp $(ALL_LOCALES))
-# This version of the target uses AB_CD to build multilocale.json and places it
+# This version of the target uses AB_CD to build multilocale.txt and places it
# in the $(XPI_NAME)/res dir - it should be used when repackaging a build.
-multilocale.json-%: LOCALES?=$(AB_CD)
-multilocale.json-%: MULTILOCALE_DIR=$(DIST)/xpi-stage/$(XPI_NAME)/res
-multilocale.json-%:
- $(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.json' $(MDDEPDIR)/multilocale.json.pp $(ALL_LOCALES))
+multilocale.txt-%: LOCALES?=$(AB_CD)
+multilocale.txt-%: MULTILOCALE_DIR=$(DIST)/xpi-stage/$(XPI_NAME)/res
+multilocale.txt-%:
+ $(call py_action,file_generate,$(MOZILLA_DIR)/toolkit/locales/gen_multilocale.py main '$(MULTILOCALE_DIR)/multilocale.txt' $(MDDEPDIR)/multilocale.txt.pp $(ALL_LOCALES))
locale-manifest.in: LOCALES?=$(MOZ_CHROME_MULTILOCALE)
locale-manifest.in: $(GLOBAL_DEPS) FORCE
printf '\n[multilocale]\n' > $@
- printf '$(BASE_PATH)/res/multilocale.json\n' >> $@
+ printf '$(BASE_PATH)/res/multilocale.txt\n' >> $@
for LOCALE in $(ALL_LOCALES) ;\
do \
for ENTRY in $(MOZ_CHROME_LOCALE_ENTRIES) ;\
do \
printf "$$ENTRY""$$LOCALE"'@JAREXT@\n' >> $@; \
printf "$$ENTRY""$$LOCALE"'.manifest\n' >> $@; \
done \
done