aboutsummaryrefslogtreecommitdiff
path: root/rules/flags/flag_defs.bzl
blob: cecb40a42bc87ef36db6ead421e45d841a99786f (plain)
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
# Copyright 2019 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Flag definitions."""

load("@rules_android//rules/flags:flags.bzl", "flags")

def define_flags():
    flags.DEFINE_bool(
        name = "android_enable_res_v3",
        default = False,
        description = "Enable Resource Processing Pipeline v3.",
    )

    flags.DEFINE_bool(
        name = "use_direct_deploy",
        default = False,
        description = "Enable direct deployment.",
    )

    flags.DEFINE_int(
        name = "num_dex_shards",
        default = 16,
        description = "Number of dex shards to use for mobile-install.",
    )

    flags.DEFINE_bool(
        name = "use_custom_dex_shards",
        default = False,
        description = "Whether to use custom dex shard value for mobile-install.",
    )

    flags.DEFINE_bool_group(
        name = "mi_v3",
        default = True,
        description = "Enable mobile-install v3.",
        flags = [
            # TODO(b/160897244): resv3 temporarily disabled while Starlark
            #     resource processing is implemented and rolled out
            # ":android_enable_res_v3",
            ":use_custom_dex_shards",
            ":use_direct_deploy",
        ],
    )

    flags.DEFINE_bool_group(
        name = "mi_dogfood",
        default = False,
        description = "Opt-in to mobile-install dogfood track.",
        flags = [
        ],
    )

    flags.DEFINE_bool(
        name = "enable_splits",
        default = False,
        description = "Build and install split apks if the device supports them.",
    )

    flags.DEFINE_bool(
        name = "use_adb_root",
        default = True,
        description = "Restart adb with root permissions.",
    )

    flags.DEFINE_bool(
        name = "mi_desugar_java8_libs",
        default = False,
        description = "Set True with --config=android_java8_libs",
    )

    flags.DEFINE_bool(
        name = "debug",
        default = False,
        description = "",
    )

    flags.EXPOSE_native_bool(
        name = "stamp",
        description = "Accesses the native --stamp CLI flag",
    )