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/.
8 "MOZ_ANDROID_EXCLUDE_FONTS",
9 help="Whether to exclude font files from the build",
14 "MOZ_ANDROID_HLS_SUPPORT",
15 help="Enable HLS (HTTP Live Streaming) support (currently using the ExoPlayer library)",
20 "--num-content-services",
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):
29 intValue = int(strValue)
30 acceptableRange = range(1, 41)
31 if intValue not in acceptableRange:
33 "Unacceptable value, must be within range [%d,%d)"
34 % (acceptableRange.start, acceptableRange.stop)
39 set_config("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)
40 set_define("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)
43 "--enable-isolated-process",
44 env="MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
45 help="Enable generating content process services with isolatedProcess=true",
49 "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
50 depends_if("MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS")(lambda x: True),
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)
63 imply_option("--enable-small-chunk-size", True)
67 def check_target(target):
68 if target.os != "Android":
70 "You must specify --target=arm-linux-androideabi (or some "
71 "other valid Android target) when building mobile/android."
74 "See https://developer.mozilla.org/docs/Mozilla/Developer_guide/"
75 "Build_Instructions/Simple_Firefox_for_Android_build "
76 "for more information about the necessary options."
80 include("../../toolkit/moz.configure")
81 include("../../build/moz.configure/android-sdk.configure")
82 include("../../build/moz.configure/java.configure")
83 include("gradle.configure")
85 # Automation will set this via the TC environment.
87 env="MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
89 choices=("armeabi-v7a", "arm64-v8a", "x86", "x86_64"),
90 help='Comma-separated list of Android CPU architectures like "armeabi-v7a,arm64-v8a,x86,x86_64"',
94 "MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
95 depends("MOZ_ANDROID_FAT_AAR_ARCHITECTURES")(lambda x: x),