no bug - Import translations from android-l10n r=release a=l10n CLOSED TREE
[gecko.git] / mobile / android / moz.configure
bloba6ba923d936e7e58d6ff4e794e3a3c1a267bcb6e
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 project_flag(
8     "MOZ_ANDROID_EXCLUDE_FONTS",
9     help="Whether to exclude font files from the build",
10     default=True,
13 project_flag(
14     "MOZ_ANDROID_HLS_SUPPORT",
15     help="Enable HLS (HTTP Live Streaming) support (currently using the ExoPlayer library)",
16     default=True,
19 option(
20     "--num-content-services",
21     default="40",
22     help="The number of content process services to generate in the GeckoView manifest",
26 @depends("--num-content-services")
27 def num_content_services(value):
28     strValue = value[0]
29     intValue = int(strValue)
30     acceptableRange = range(1, 41)
31     if intValue not in acceptableRange:
32         die(
33             "Unacceptable value, must be within range [%d,%d)"
34             % (acceptableRange.start, acceptableRange.stop)
35         )
36     return strValue
39 set_config("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)
40 set_define("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)
42 option(
43     "--enable-isolated-process",
44     env="MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
45     help="Enable generating content process services with isolatedProcess=true",
46     default=False,
48 set_config(
49     "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
50     depends_if("MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS")(lambda x: True),
53 option(
54     "--enable-geckoview-lite",
55     help="Build GeckoView in Lite mode. Lite mode removes all unnecessary dependencies like Glean.",
58 set_config("MOZ_ANDROID_GECKOVIEW_LITE", True, when="--enable-geckoview-lite")
60 imply_option("MOZ_NORMANDY", False)
61 imply_option("MOZ_SERVICES_HEALTHREPORT", True)
62 imply_option("MOZ_ANDROID_HISTORY", True)
65 @depends(target)
66 def check_target(target):
67     if target.os != "Android":
68         log.error(
69             "You must specify --target=arm-linux-androideabi (or some "
70             "other valid Android target) when building mobile/android."
71         )
72         die(
73             "See https://developer.mozilla.org/docs/Mozilla/Developer_guide/"
74             "Build_Instructions/Simple_Firefox_for_Android_build "
75             "for more information about the necessary options."
76         )
79 include("../../toolkit/moz.configure")
80 include("../../build/moz.configure/android-sdk.configure")
81 include("../../build/moz.configure/java.configure")
82 include("gradle.configure")
84 # Automation will set this via the TC environment.
85 option(
86     env="MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
87     nargs="*",
88     choices=("armeabi-v7a", "arm64-v8a", "x86", "x86_64"),
89     help='Comma-separated list of Android CPU architectures like "armeabi-v7a,arm64-v8a,x86,x86_64"',
92 set_config(
93     "MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
94     depends("MOZ_ANDROID_FAT_AAR_ARCHITECTURES")(lambda x: x),