aboutsummaryrefslogtreecommitdiff
path: root/mobile_install/tools.bzl
blob: 70c49c5c454ab2d3c2362e26f52a6dfdb7b322df (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
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# Copyright 2018 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.
"""Tools needed by the mobile-install aspect defined as aspect attributes."""

load(":dependency_map.bzl", "versioned_deps")

TOOL_ATTRS = dict(
    # Target Attrs
    # This library should not be versioned. It needs to be built with the same
    # config that is used to build the app. Android binds the application to a
    # concrete achitecture during install time. If no libs are on the apk, it
    # will select the most specific to the device is running. We want to use
    # whatever the user builds as long as it is compatible. And since we push
    # the native libs outside the apk to speed up transfer times, we need to
    # use dummy libs.
    _android_sdk = attr.label(
        default = Label(
            "//tools/android:android_jar",
        ),
        allow_files = True,
        cfg = "target",
    ),
    _flags = attr.label(
        default = Label(
            "//rules/flags",
        ),
    ),
    _studio_deployer = attr.label(
        default = "//tools/android:gen_fail", # TODO(#119): Studio deployer jar to be released
        allow_single_file = True,
        cfg = "exec",
        executable = True,
    ),
    _mi_shell_dummy_native_libs = attr.label(
        default = Label(
            "//tools/android:gen_fail", # FIXME: Unused internally
        ),
        allow_single_file = True,
        cfg = "target",
    ),
    _mi_shell_app = attr.label(
        default = versioned_deps.mi_shell_app.head,
        allow_files = True,
        cfg = "target",
        executable = True,
    ),
    _mi_java8_legacy_dex = attr.label(
        default = Label("//tools/android:java8_legacy_dex"),
        allow_single_file = True,
        cfg = "target",
    ),

    # Host Attrs
    _aapt2 = attr.label(
        default = Label(
            "@androidsdk//:aapt2_binary",
        ),
        allow_single_file = True,
        cfg = "exec",
        executable = True,
    ),
    _android_test_runner = attr.label(
        default = Label(
            "@bazel_tools//tools/jdk:TestRunner_deploy.jar",
        ),
        allow_single_file = True,
        cfg = "exec",
        executable = True,
    ),
    _apk_signer = attr.label(
        default = Label("@androidsdk//:apksigner"),
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _desugar_java8 = attr.label(
        default = Label("//tools/android:desugar_java8"),
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _d8 = attr.label(
        default = Label("//tools/android:d8"),
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _host_java_runtime = attr.label(
        default = Label("//tools/jdk:current_host_java_runtime"),
        cfg = "exec",
    ),
    _java_jdk = attr.label(
        default = Label("//tools/jdk:current_java_runtime"),
        allow_files = True,
        cfg = "exec",
    ),
    _resource_busybox = attr.label(
        default = Label("@bazel_tools//src/tools/android/java/com/google/devtools/build/android:ResourceProcessorBusyBox_deploy.jar"),
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _zipalign = attr.label(
        default = Label(
            "@androidsdk//:zipalign_binary",
        ),
        allow_single_file = True,
        cfg = "exec",
        executable = True,
    ),


    # Versioned Host Attrs
    _android_kit = attr.label(
        default = versioned_deps.android_kit.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _deploy = attr.label(
        default = versioned_deps.deploy.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _deploy_info = attr.label(
        default = versioned_deps.deploy_info.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _jar_tool = attr.label(
        default = versioned_deps.jar_tool.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _make_sync = attr.label(
        default = versioned_deps.make_sync.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _merge_syncs = attr.label(
        default = versioned_deps.merge_syncs.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _mi_android_java_toolchain = attr.label(
        default = Label("//tools/jdk:toolchain_android_only"),
    ),
    _mi_java_toolchain = attr.label(
        cfg = "exec",
        default = Label("//tools/jdk:toolchain"),
    ),
    _mi_host_javabase = attr.label(
        default = Label("//tools/jdk:current_host_java_runtime"),
    ),
    _pack_dexes = attr.label(
        default = versioned_deps.pack_dexes.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _pack_generic = attr.label(
        default = versioned_deps.pack_generic.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),
    _res_v3_dummy_manifest = attr.label(
        allow_single_file = True,
        default = versioned_deps.res_v3_dummy_manifest.head,
    ),
    _res_v3_dummy_r_txt = attr.label(
        allow_single_file = True,
        default = versioned_deps.res_v3_dummy_r_txt.head,
    ),
    _resource_extractor = attr.label(
        allow_single_file = True,
        cfg = "exec",
        default = versioned_deps.resource_extractor.head,
        executable = True,
    ),
    _sync_merger = attr.label(
        default = versioned_deps.sync_merger.head,
        allow_files = True,
        cfg = "exec",
        executable = True,
    ),

)