File: moz.configure

package info (click to toggle)
firefox 147.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,532 kB
  • sloc: cpp: 7,607,356; javascript: 6,533,348; ansic: 3,775,236; python: 1,415,508; xml: 634,561; asm: 438,949; java: 186,241; sh: 62,760; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (188 lines) | stat: -rw-r--r-- 5,441 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# -*- 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/.

project_flag(
    "MOZ_ANDROID_EXCLUDE_FONTS",
    help="Whether to exclude font files from the build",
    default=True,
)

project_flag(
    "MOZ_ANDROID_HLS_SUPPORT",
    help="Enable HLS (HTTP Live Streaming) support (currently using the ExoPlayer library)",
    default=True,
)

option(
    "--num-content-services",
    default="40",
    help="The number of content process services to generate in the GeckoView manifest",
)


@depends("--num-content-services")
def num_content_services(value):
    strValue = value[0]
    intValue = int(strValue)
    acceptableRange = range(1, 41)
    if intValue not in acceptableRange:
        die(
            "Unacceptable value, must be within range [%d,%d)"
            % (acceptableRange.start, acceptableRange.stop)
        )
    return strValue


set_config("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)
set_define("MOZ_ANDROID_CONTENT_SERVICE_COUNT", num_content_services)

option(
    "--enable-isolated-zygote-process",
    env="MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE",
    help="Enable generating content process services with app Zygote preloading and isolated processes",
    default=False,
)

isIsolatedAppZygoteProcessEnabled = depends_if(
    "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE"
)(lambda _: True)
set_config(
    "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE",
    isIsolatedAppZygoteProcessEnabled,
)
set_define(
    "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_WITH_ZYGOTE",
    isIsolatedAppZygoteProcessEnabled,
)

option(
    "--enable-isolated-process",
    env="MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
    help="Enable generating content process services with isolatedProcess=true",
    default=False,
)

isIsolatedProcessEnabled = depends_if("MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS")(
    lambda _: True
)
set_config(
    "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
    isIsolatedProcessEnabled,
)
set_define(
    "MOZ_ANDROID_CONTENT_SERVICE_ISOLATED_PROCESS",
    isIsolatedProcessEnabled,
)

option(
    "--enable-geckoview-lite",
    help="Build GeckoView in Lite mode. Lite mode removes all unnecessary dependencies like Glean",
)

set_config("MOZ_ANDROID_GECKOVIEW_LITE", True, when="--enable-geckoview-lite")

option(
    "--enable-android-subproject",
    choices=(
        "fenix",
        "focus",
        "geckoview_example",
    ),
    nargs="?",
    help="Build a subproject of android. Possible options: fenix/focus/geckoview_example",
)


@depends("--enable-android-subproject")
def android_subproject(value):
    if value:
        return value[0]


set_config("MOZ_ANDROID_SUBPROJECT", android_subproject)


# The android:debuggable flag controls if a debugger can be attached on to the
# running app. Default this setting to follow `--enable-debug`. Use this flag to
# allow attaching debugging to app compiled in an optimized / release
# configuration.
#
# NOTE: There are numerous performance implications for a package marked as
#       android:debuggable versus a similar one that isn't. Particularly around
#       AOT compilation heuristics and caches.

option(
    "--enable-android-debuggable",
    default=moz_debug,
    help="{Enable|Disable} the android:debuggable flag in AndroidManifest.xml",
)


@depends("--enable-android-debuggable")
def android_debuggable(value):
    if value:
        return True


set_config("MOZ_ANDROID_DEBUGGABLE", android_debuggable)


imply_option("MOZ_NORMANDY", False)
imply_option("MOZ_SERVICES_HEALTHREPORT", True)
imply_option("MOZ_GECKOVIEW_HISTORY", True)

imply_option("MOZ_APP_UA_NAME", "Firefox")
imply_option("MOZ_APP_VENDOR", "Mozilla")
imply_option("MOZ_APP_ID", "{aa3c5121-dab2-40e2-81ca-7ea25febc110}")
imply_option("BROWSER_CHROME_URL", "chrome://geckoview/content/geckoview.xhtml")

option(
    "--enable-appservices-in-tree",
    help="Enables building from an in-tree app-services",
)


@depends("--enable-appservices-in-tree")
def enable_appservices_in_tree(value):
    if value:
        return True


set_config("MOZ_APPSERVICES_IN_TREE", enable_appservices_in_tree)


@depends(target)
def check_target(target):
    if target.os != "Android":
        log.error(
            "You must specify --target=arm-linux-androideabi (or some "
            "other valid Android target) when building mobile/android."
        )
        die(
            "See https://developer.mozilla.org/docs/Mozilla/Developer_guide/"
            "Build_Instructions/Simple_Firefox_for_Android_build "
            "for more information about the necessary options."
        )


include("../shared/moz.configure")
include("../../toolkit/moz.configure")
include("../../build/moz.configure/android-sdk.configure")
include("../../build/moz.configure/java.configure")
include("gradle.configure")

# Automation will set this via the TC environment.
option(
    env="MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
    nargs="*",
    choices=("armeabi-v7a", "arm64-v8a", "x86_64"),
    help='Comma-separated list of Android CPU architectures like "armeabi-v7a,arm64-v8a,x86_64"',
)

set_config(
    "MOZ_ANDROID_FAT_AAR_ARCHITECTURES",
    depends("MOZ_ANDROID_FAT_AAR_ARCHITECTURES")(lambda x: x),
)