herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 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 | |
| 15 | python_defaults { |
| 16 | name: "acloud_default", |
Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 17 | pkg_path: "acloud", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 18 | version: { |
| 19 | py2: { |
chojoyce | c5ee4a7 | 2020-07-23 23:32:25 +0800 | [diff] [blame] | 20 | enabled: false, |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 21 | embedded_launcher: false, |
chojoyce | 2a82d30 | 2019-12-24 18:13:36 +0800 | [diff] [blame] | 22 | libs: [ |
| 23 | "py-pyopenssl", |
| 24 | ] |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 25 | }, |
| 26 | py3: { |
chojoyce | c5ee4a7 | 2020-07-23 23:32:25 +0800 | [diff] [blame] | 27 | enabled: true, |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 28 | embedded_launcher: false, |
| 29 | }, |
| 30 | }, |
| 31 | } |
| 32 | |
| 33 | python_binary_host { |
| 34 | name: "acloud", |
chojoyce | c5ee4a7 | 2020-07-23 23:32:25 +0800 | [diff] [blame] | 35 | // Make acloud's built name to acloud-dev default build python3 binary. |
herbertxue | 00b241b | 2019-04-08 12:04:44 +0800 | [diff] [blame] | 36 | stem: "acloud-dev", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 37 | defaults: ["acloud_default"], |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 38 | main: "public/acloud_main.py", |
| 39 | srcs: [ |
| 40 | "public/acloud_main.py", |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 41 | "errors.py" |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 42 | ], |
| 43 | data: [ |
| 44 | "public/data/default.config", |
Roland Levillain | 3550f0e | 2020-09-08 19:05:25 +0100 | [diff] [blame] | 45 | ":acloud_version", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 46 | ], |
| 47 | libs: [ |
Kevin Cheng | 3087af5 | 2018-08-13 13:26:50 -0700 | [diff] [blame] | 48 | "acloud_create", |
Kevin Cheng | eb85e86 | 2018-10-09 15:35:13 -0700 | [diff] [blame] | 49 | "acloud_delete", |
Jaewoong Jung | 2a029f0 | 2019-01-24 13:21:42 -0800 | [diff] [blame] | 50 | "acloud_reconnect", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 51 | "acloud_internal", |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 52 | "acloud_list", |
herbertxue | 61bfd97 | 2019-09-24 15:51:52 +0800 | [diff] [blame] | 53 | "acloud_pull", |
herbertxue | 2ebd414 | 2020-07-30 19:37:37 +0800 | [diff] [blame] | 54 | "acloud_powerwash", |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 55 | "acloud_metrics", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 56 | "acloud_proto", |
Kevin Cheng | 6001db3 | 2018-10-23 12:34:20 -0700 | [diff] [blame] | 57 | "acloud_public", |
herbertxue | 282e2a5 | 2021-01-13 19:49:05 +0800 | [diff] [blame] | 58 | "acloud_restart", |
Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 59 | "acloud_setup", |
Kevin Cheng | 7639d5f | 2018-06-14 13:44:46 -0700 | [diff] [blame] | 60 | "py-apitools", |
Kevin Cheng | 31e8429 | 2018-05-30 16:08:50 -0700 | [diff] [blame] | 61 | "py-dateutil", |
Kevin Cheng | 7639d5f | 2018-06-14 13:44:46 -0700 | [diff] [blame] | 62 | "py-google-api-python-client", |
| 63 | "py-oauth2client", |
chojoyce | 92d884b | 2019-10-14 16:53:17 +0800 | [diff] [blame] | 64 | "py-six", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 65 | ], |
Jaewoong Jung | 2a029f0 | 2019-01-24 13:21:42 -0800 | [diff] [blame] | 66 | dist: { |
| 67 | targets: ["droidcore"], |
| 68 | }, |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 69 | } |
| 70 | |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 71 | python_test_host { |
| 72 | name: "acloud_test", |
| 73 | main: "acloud_test.py", |
| 74 | defaults: ["acloud_default"], |
Kevin Cheng | 4fce0bc | 2018-08-13 11:51:34 -0700 | [diff] [blame] | 75 | data: [ |
| 76 | "public/data/default.config", |
| 77 | ], |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 78 | srcs: [ |
| 79 | "acloud_test.py", |
Kevin Cheng | ccfac9b | 2018-09-21 09:50:35 -0700 | [diff] [blame] | 80 | "errors.py", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 81 | "public/*_test.py", |
| 82 | "public/actions/*_test.py", |
| 83 | "internal/lib/*_test.py", |
Sam Chiu | e791f60 | 2019-05-03 15:18:10 +0800 | [diff] [blame] | 84 | "metrics/*.py", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 85 | ], |
| 86 | libs: [ |
Kevin Cheng | 86d43c7 | 2018-08-30 10:59:14 -0700 | [diff] [blame] | 87 | "acloud_create", |
Kevin Cheng | eb85e86 | 2018-10-09 15:35:13 -0700 | [diff] [blame] | 88 | "acloud_delete", |
herbertxue | 61bfd97 | 2019-09-24 15:51:52 +0800 | [diff] [blame] | 89 | "acloud_reconnect", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 90 | "acloud_internal", |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 91 | "acloud_list", |
herbertxue | 61bfd97 | 2019-09-24 15:51:52 +0800 | [diff] [blame] | 92 | "acloud_pull", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 93 | "acloud_proto", |
Kevin Cheng | 86d43c7 | 2018-08-30 10:59:14 -0700 | [diff] [blame] | 94 | "acloud_public", |
herbertxue | 282e2a5 | 2021-01-13 19:49:05 +0800 | [diff] [blame] | 95 | "acloud_restart", |
Sam Chiu | 4bb604a | 2018-10-05 18:29:10 +0800 | [diff] [blame] | 96 | "acloud_setup", |
Sam Chiu | e791f60 | 2019-05-03 15:18:10 +0800 | [diff] [blame] | 97 | "asuite_cc_client", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 98 | "py-apitools", |
| 99 | "py-dateutil", |
| 100 | "py-google-api-python-client", |
Kevin Cheng | 60db1bc | 2018-09-24 12:20:25 -0700 | [diff] [blame] | 101 | "py-mock", |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 102 | "py-oauth2client", |
| 103 | ], |
Kevin Cheng | cecb7fe | 2018-10-02 10:40:18 -0700 | [diff] [blame] | 104 | test_config: "acloud_unittest.xml", |
Dan Shi | 7f4cd09 | 2020-11-02 11:59:42 -0800 | [diff] [blame] | 105 | test_suites: [ |
| 106 | "general-tests", |
Dan Shi | 7f4cd09 | 2020-11-02 11:59:42 -0800 | [diff] [blame] | 107 | ], |
Dan Shi | ee3af52 | 2020-11-17 21:03:13 -0800 | [diff] [blame] | 108 | test_options: { |
| 109 | unit_test: true, |
| 110 | } |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | python_library_host { |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 114 | name: "acloud_public", |
| 115 | defaults: ["acloud_default"], |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 116 | srcs: [ |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 117 | "public/*.py", |
| 118 | "public/actions/*.py", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 119 | ], |
| 120 | exclude_srcs: [ |
| 121 | "public/*_test.py", |
| 122 | "public/actions/*_test.py", |
| 123 | "public/acloud_main.py", |
| 124 | ] |
| 125 | } |
| 126 | |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 127 | python_library_host { |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 128 | name: "acloud_internal", |
| 129 | defaults: ["acloud_default"], |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 130 | srcs: [ |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 131 | "internal/*.py", |
| 132 | "internal/lib/*.py", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 133 | ], |
| 134 | exclude_srcs: [ |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 135 | "internal/lib/*_test.py", |
| 136 | ] |
| 137 | } |
| 138 | |
Kevin Cheng | da4f07a | 2018-06-26 10:25:05 -0700 | [diff] [blame] | 139 | python_library_host { |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 140 | name: "acloud_proto", |
| 141 | defaults: ["acloud_default"], |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 142 | srcs: [ |
Kevin Cheng | 8131d75 | 2018-06-06 14:38:43 -0700 | [diff] [blame] | 143 | "internal/proto/*.proto", |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 144 | ], |
Kevin Cheng | 8131d75 | 2018-06-06 14:38:43 -0700 | [diff] [blame] | 145 | proto: { |
| 146 | canonical_path_from_root: false, |
| 147 | }, |
herbertxue | 615af07 | 2018-05-24 09:39:17 +0000 | [diff] [blame] | 148 | } |
Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 149 | |
| 150 | python_library_host{ |
| 151 | name: "acloud_setup", |
| 152 | defaults: ["acloud_default"], |
| 153 | srcs: [ |
| 154 | "setup/*.py", |
| 155 | ], |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 156 | exclude_srcs: [ |
| 157 | "setup/*_test.py", |
| 158 | ], |
Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 159 | } |
Kevin Cheng | 3087af5 | 2018-08-13 13:26:50 -0700 | [diff] [blame] | 160 | |
| 161 | python_library_host{ |
| 162 | name: "acloud_create", |
| 163 | defaults: ["acloud_default"], |
| 164 | srcs: [ |
| 165 | "create/*.py", |
| 166 | ], |
| 167 | } |
Kevin Cheng | eb85e86 | 2018-10-09 15:35:13 -0700 | [diff] [blame] | 168 | |
| 169 | python_library_host{ |
| 170 | name: "acloud_delete", |
| 171 | defaults: ["acloud_default"], |
| 172 | srcs: [ |
| 173 | "delete/*.py", |
| 174 | ], |
| 175 | } |
Kevin Cheng | 6001db3 | 2018-10-23 12:34:20 -0700 | [diff] [blame] | 176 | |
| 177 | python_library_host{ |
Sam Chiu | 5029a25 | 2018-11-06 20:54:13 +0800 | [diff] [blame] | 178 | name: "acloud_list", |
| 179 | defaults: ["acloud_default"], |
| 180 | srcs: [ |
| 181 | "list/*.py", |
| 182 | ], |
| 183 | } |
| 184 | |
| 185 | python_library_host{ |
cylan | 4569dca | 2018-11-02 12:12:53 +0800 | [diff] [blame] | 186 | name: "acloud_reconnect", |
| 187 | defaults: ["acloud_default"], |
| 188 | srcs: [ |
| 189 | "reconnect/*.py", |
| 190 | ], |
| 191 | } |
| 192 | |
| 193 | python_library_host{ |
herbertxue | 61bfd97 | 2019-09-24 15:51:52 +0800 | [diff] [blame] | 194 | name: "acloud_pull", |
| 195 | defaults: ["acloud_default"], |
| 196 | srcs: [ |
| 197 | "pull/*.py", |
| 198 | ], |
| 199 | } |
| 200 | |
| 201 | python_library_host{ |
herbertxue | 2ebd414 | 2020-07-30 19:37:37 +0800 | [diff] [blame] | 202 | name: "acloud_powerwash", |
| 203 | defaults: ["acloud_default"], |
| 204 | srcs: [ |
| 205 | "powerwash/*.py", |
| 206 | ], |
| 207 | } |
| 208 | |
| 209 | python_library_host{ |
herbertxue | 282e2a5 | 2021-01-13 19:49:05 +0800 | [diff] [blame] | 210 | name: "acloud_restart", |
| 211 | defaults: ["acloud_default"], |
| 212 | srcs: [ |
| 213 | "restart/*.py", |
| 214 | ], |
| 215 | } |
| 216 | |
| 217 | python_library_host{ |
Kevin Cheng | 6001db3 | 2018-10-23 12:34:20 -0700 | [diff] [blame] | 218 | name: "acloud_metrics", |
| 219 | defaults: ["acloud_default"], |
| 220 | srcs: [ |
| 221 | "metrics/*.py", |
| 222 | ], |
| 223 | libs: [ |
Sam Chiu | e791f60 | 2019-05-03 15:18:10 +0800 | [diff] [blame] | 224 | "asuite_cc_client", |
Kevin Cheng | 6001db3 | 2018-10-23 12:34:20 -0700 | [diff] [blame] | 225 | "asuite_metrics", |
| 226 | ], |
| 227 | } |
cylan | 9af1469 | 2020-02-21 18:11:35 +0800 | [diff] [blame] | 228 | |
| 229 | genrule { |
| 230 | name: "acloud_version", |
| 231 | tool_files: ["gen_version.sh"], |
| 232 | cmd: "$(location gen_version.sh) $(out)", |
| 233 | out: ["public/data/VERSION"], |
| 234 | } |