2022-06-09 15:48:59 -05:00
|
|
|
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
|
|
|
|
--- a/python/mozbuild/mozbuild/mach_commands.py
|
|
|
|
+++ b/python/mozbuild/mozbuild/mach_commands.py
|
|
|
|
@@ -2468,11 +2468,11 @@
|
|
|
|
@CommandArgument(
|
|
|
|
"--locales",
|
|
|
|
metavar="LOCALES",
|
|
|
|
nargs="+",
|
|
|
|
required=True,
|
|
|
|
- help='List of locales to package, including "en-US"',
|
2022-06-12 13:28:57 -05:00
|
|
|
+ help="List of locales to package",
|
2022-06-09 15:48:59 -05:00
|
|
|
)
|
|
|
|
@CommandArgument(
|
|
|
|
"--verbose", action="store_true", help="Log informative status messages."
|
|
|
|
)
|
|
|
|
def package_l10n(command_context, verbose=False, locales=[]):
|
2022-06-12 13:28:57 -05:00
|
|
|
@@ -2484,55 +2484,33 @@
|
2022-06-09 15:48:59 -05:00
|
|
|
"export BUILD_BACKENDS=FasterMake,RecursiveMake\n"
|
|
|
|
"in your mozconfig."
|
|
|
|
)
|
|
|
|
return 1
|
|
|
|
|
|
|
|
- if "en-US" not in locales:
|
|
|
|
- command_context.log(
|
|
|
|
- logging.WARN,
|
|
|
|
- "package-multi-locale",
|
|
|
|
- {"locales": locales},
|
|
|
|
- 'List of locales does not include default locale "en-US": '
|
|
|
|
- '{locales}; adding "en-US"',
|
|
|
|
- )
|
|
|
|
- locales.append("en-US")
|
|
|
|
- locales = list(sorted(locales))
|
2022-06-15 04:48:45 -05:00
|
|
|
+ locales = sorted(locale for locale in locales if locale != "en-US")
|
2022-06-09 15:48:59 -05:00
|
|
|
|
|
|
|
append_env = {
|
|
|
|
# We are only (re-)packaging, we don't want to (re-)build
|
|
|
|
# anything inside Gradle.
|
|
|
|
"GRADLE_INVOKED_WITHIN_MACH_BUILD": "1",
|
|
|
|
"MOZ_CHROME_MULTILOCALE": " ".join(locales),
|
|
|
|
}
|
|
|
|
|
|
|
|
- for locale in locales:
|
|
|
|
- if locale == "en-US":
|
|
|
|
- command_context.log(
|
|
|
|
- logging.INFO,
|
|
|
|
- "package-multi-locale",
|
|
|
|
- {"locale": locale},
|
|
|
|
- "Skipping default locale {locale}",
|
|
|
|
- )
|
|
|
|
- continue
|
|
|
|
-
|
|
|
|
- command_context.log(
|
|
|
|
- logging.INFO,
|
|
|
|
- "package-multi-locale",
|
|
|
|
- {"locale": locale},
|
|
|
|
- "Processing chrome Gecko resources for locale {locale}",
|
|
|
|
- )
|
|
|
|
- command_context.run_process(
|
|
|
|
- [
|
|
|
|
- mozpath.join(command_context.topsrcdir, "mach"),
|
|
|
|
- "build",
|
|
|
|
- "chrome-{}".format(locale),
|
|
|
|
- ],
|
|
|
|
- append_env=append_env,
|
|
|
|
- pass_thru=True,
|
|
|
|
- ensure_exit_code=True,
|
|
|
|
- cwd=mozpath.join(command_context.topsrcdir),
|
|
|
|
- )
|
|
|
|
+ command_context.log(
|
|
|
|
+ logging.INFO,
|
|
|
|
+ "package-multi-locale",
|
|
|
|
+ {"locales": locales},
|
|
|
|
+ "Processing chrome Gecko resources for locales {locales}",
|
|
|
|
+ )
|
2022-06-12 13:28:57 -05:00
|
|
|
+ command_context._run_make(
|
2022-06-15 04:48:45 -05:00
|
|
|
+ directory=command_context.topobjdir,
|
|
|
|
+ target=["chrome-{}".format(locale) for locale in locales],
|
2022-06-09 15:48:59 -05:00
|
|
|
+ append_env=append_env,
|
2022-06-12 13:28:57 -05:00
|
|
|
+ pass_thru=False,
|
|
|
|
+ print_directory=False,
|
2022-06-09 15:48:59 -05:00
|
|
|
+ ensure_exit_code=True,
|
|
|
|
+ )
|
|
|
|
|
|
|
|
if command_context.substs["MOZ_BUILD_APP"] == "mobile/android":
|
|
|
|
command_context.log(
|
|
|
|
logging.INFO,
|
|
|
|
"package-multi-locale",
|
|
|
|
|