1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_partner_eng",
17    default_applicable_licenses: ["tools_acloud_license"],
18}
19
20// Added automatically by a large-scale-change
21// http://go/android-license-faq
22license {
23    name: "tools_acloud_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-Apache-2.0",
27    ],
28    license_text: [
29        "LICENSE",
30    ],
31}
32
33python_binary_host {
34    name: "acloud",
35    // Make acloud's built name to acloud-dev default build python3 binary.
36    stem: "acloud-dev",
37    pkg_path: "acloud",
38    main: "public/acloud_main.py",
39    srcs: [
40        "public/acloud_main.py",
41        "errors.py",
42    ],
43    data: [
44        "public/data/default.config",
45        ":acloud_version",
46    ],
47    libs: [
48        "acloud_create",
49        "acloud_delete",
50        "acloud_reconnect",
51        "acloud_internal",
52        "acloud_list",
53        "acloud_pull",
54        "acloud_powerwash",
55        "acloud_metrics",
56        "acloud_proto",
57        "acloud_public",
58        "acloud_restart",
59        "acloud_setup",
60        "acloud_hostcleanup",
61        "py-apitools",
62        "py-dateutil",
63        "py-google-api-python-client",
64        "py-oauth2client",
65        "py-six",
66    ],
67    dist: {
68        targets: ["droidcore"],
69    },
70    version: {
71        py3: {
72            // TODO(b/174041232): Make acloud work with embedded_launcher
73            embedded_launcher: false,
74        },
75    },
76}
77
78python_test_host {
79    name: "acloud_test",
80    pkg_path: "acloud",
81    main: "acloud_test.py",
82    data: [
83        "public/data/default.config",
84    ],
85    srcs: [
86        "acloud_test.py",
87        "errors.py",
88        "public/*_test.py",
89        "public/actions/*_test.py",
90        "internal/lib/*_test.py",
91        "metrics/*.py",
92    ],
93    libs: [
94        "acloud_create",
95        "acloud_delete",
96        "acloud_reconnect",
97        "acloud_internal",
98        "acloud_list",
99        "acloud_powerwash",
100        "acloud_public",
101        "acloud_pull",
102        "acloud_proto",
103        "acloud_restart",
104        "acloud_setup",
105        "acloud_hostcleanup",
106        "asuite_cc_client",
107        "py-apitools",
108        "py-dateutil",
109        "py-google-api-python-client",
110        "py-oauth2client",
111    ],
112    test_config: "acloud_unittest.xml",
113    test_suites: [
114        "general-tests",
115    ],
116    test_options: {
117        // TODO(b/270225397)
118        unit_test: false,
119        tags: ["no-remote"],
120    },
121}
122
123python_library_host {
124    name: "acloud_public",
125    pkg_path: "acloud",
126    srcs: [
127        "public/*.py",
128        "public/actions/*.py",
129    ],
130    exclude_srcs: [
131        "public/*_test.py",
132        "public/actions/*_test.py",
133        "public/acloud_main.py",
134    ],
135}
136
137python_library_host {
138    name: "acloud_internal",
139    pkg_path: "acloud",
140    srcs: [
141        "internal/*.py",
142        "internal/lib/*.py",
143    ],
144    exclude_srcs: [
145        "internal/lib/*_test.py",
146    ],
147}
148
149python_library_host {
150    name: "acloud_proto",
151    pkg_path: "acloud",
152    srcs: [
153        "internal/proto/*.proto",
154    ],
155    proto: {
156        canonical_path_from_root: false,
157    },
158}
159
160python_library_host {
161    name: "acloud_setup",
162    pkg_path: "acloud",
163    srcs: [
164        "setup/*.py",
165    ],
166    exclude_srcs: [
167        "setup/*_test.py",
168    ],
169}
170
171python_library_host {
172    name: "acloud_create",
173    pkg_path: "acloud",
174    srcs: [
175        "create/*.py",
176    ],
177}
178
179python_library_host {
180    name: "acloud_delete",
181    pkg_path: "acloud",
182    srcs: [
183        "delete/*.py",
184    ],
185}
186
187python_library_host {
188    name: "acloud_list",
189    pkg_path: "acloud",
190    srcs: [
191        "list/*.py",
192    ],
193}
194
195python_library_host {
196    name: "acloud_reconnect",
197    pkg_path: "acloud",
198    srcs: [
199        "reconnect/*.py",
200    ],
201}
202
203python_library_host {
204    name: "acloud_pull",
205    pkg_path: "acloud",
206    srcs: [
207        "pull/*.py",
208    ],
209}
210
211python_library_host {
212    name: "acloud_powerwash",
213    pkg_path: "acloud",
214    srcs: [
215        "powerwash/*.py",
216    ],
217}
218
219python_library_host {
220    name: "acloud_restart",
221    pkg_path: "acloud",
222    srcs: [
223        "restart/*.py",
224    ],
225}
226
227python_library_host {
228    name: "acloud_hostcleanup",
229    pkg_path: "acloud",
230    srcs: [
231        "hostcleanup/*.py",
232    ],
233}
234
235python_library_host {
236    name: "acloud_metrics",
237    pkg_path: "acloud",
238    srcs: [
239        "metrics/*.py",
240    ],
241    libs: [
242        "asuite_cc_client",
243    ],
244}
245
246genrule {
247    name: "acloud_version",
248    tool_files: ["gen_version.sh"],
249    cmd: "$(location gen_version.sh) $(out)",
250    out: ["public/data/VERSION"],
251}
252