blob: 3732b783e118c5154b69997691fc4ef8a82af3f4 [file] [log] [blame]
Tao Bao30e31142019-04-09 00:12:30 -07001// Copyright (C) 2019 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
15python_defaults {
Tao Bao2bbb07c2019-05-07 13:12:21 -070016 name: "releasetools_library_defaults",
Tao Bao30e31142019-04-09 00:12:30 -070017 version: {
18 py2: {
19 enabled: true,
Tao Bao30e31142019-04-09 00:12:30 -070020 },
21 py3: {
Tao Baoca82fc92019-05-01 21:58:03 -070022 enabled: true,
Tao Bao30e31142019-04-09 00:12:30 -070023 },
24 },
25}
26
27python_library_host {
Tao Bao005305a2019-08-05 13:00:44 -070028 name: "releasetools_build_super_image",
29 defaults: ["releasetools_library_defaults"],
30 srcs: [
31 "build_super_image.py",
32 ],
33}
34
35python_library_host {
Tao Bao2bbb07c2019-05-07 13:12:21 -070036 name: "releasetools_common",
37 defaults: ["releasetools_library_defaults"],
Tao Bao30e31142019-04-09 00:12:30 -070038 srcs: [
Tao Bao30e31142019-04-09 00:12:30 -070039 "blockimgdiff.py",
Tao Bao30e31142019-04-09 00:12:30 -070040 "common.py",
Tianjie Xu41976c72019-07-03 13:57:01 -070041 "images.py",
Tao Bao30e31142019-04-09 00:12:30 -070042 "rangelib.py",
Tao Bao30e31142019-04-09 00:12:30 -070043 "sparse_img.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -070044 ],
45 // Only the tools that are referenced directly are listed as required modules. For example,
46 // `avbtool` is not here, as the script always uses the one from info_dict['avb_avbtool'].
47 required: [
48 "aapt",
49 "boot_signer",
50 "brotli",
51 "bsdiff",
52 "imgdiff",
53 "minigzip",
54 "mkbootfs",
55 ],
56}
57
58python_library_host {
59 name: "releasetools_verity_utils",
60 defaults: ["releasetools_library_defaults"],
61 srcs: [
Tao Bao30e31142019-04-09 00:12:30 -070062 "verity_utils.py",
63 ],
Tao Bao2bbb07c2019-05-07 13:12:21 -070064 required: [
65 "append2simg",
66 "build_verity_metadata",
67 "build_verity_tree",
68 "fec",
69 ],
70}
71
72python_defaults {
73 name: "releasetools_binary_defaults",
74 version: {
75 py2: {
76 enabled: true,
77 embedded_launcher: true,
78 },
79 py3: {
80 enabled: false,
81 embedded_launcher: false,
82 },
83 },
84}
85
86python_binary_host {
87 name: "build_image",
88 defaults: ["releasetools_binary_defaults"],
89 srcs: [
90 "build_image.py",
91 ],
92 main: "build_image.py",
93 libs: [
94 "releasetools_common",
95 "releasetools_verity_utils",
96 ],
97 required: [
98 "blk_alloc_to_base_fs",
99 "e2fsck",
100 "simg2img",
101 "tune2fs",
102 ],
103}
104
105python_binary_host {
106 name: "build_super_image",
107 defaults: ["releasetools_binary_defaults"],
108 srcs: [
109 "build_super_image.py",
110 ],
111 main: "build_super_image.py",
112 libs: [
113 "releasetools_common",
114 ],
Tao Bao30e31142019-04-09 00:12:30 -0700115}
116
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700117python_binary_host {
Tao Baoe11a4602019-08-06 23:21:23 -0700118 name: "make_recovery_patch",
119 defaults: ["releasetools_binary_defaults"],
120 srcs: [
121 "make_recovery_patch.py",
122 ],
123 libs: [
124 "releasetools_common",
125 ],
126}
127
128python_binary_host {
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700129 name: "merge_builds",
130 defaults: ["releasetools_binary_defaults"],
131 srcs: [
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700132 "merge_builds.py",
133 ],
134 main: "merge_builds.py",
135 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700136 "releasetools_build_super_image",
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700137 "releasetools_common",
138 ],
139}
140
Tao Bao8821d642019-08-05 12:05:45 -0700141python_binary_host {
142 name: "ota_from_target_files",
143 defaults: ["releasetools_binary_defaults"],
144 srcs: [
145 "edify_generator.py",
146 "ota_from_target_files.py",
Tao Bao49674832019-08-07 12:53:19 -0700147 "target_files_diff.py",
Tao Bao8821d642019-08-05 12:05:45 -0700148 ],
Tao Bao49674832019-08-07 12:53:19 -0700149 main: "ota_from_target_files.py",
Tao Bao8821d642019-08-05 12:05:45 -0700150 libs: [
151 "releasetools_common",
152 "releasetools_verity_utils",
153 ],
154 required: [
155 "brillo_update_payload",
156 ],
157}
158
Tao Baoe11a4602019-08-06 23:21:23 -0700159python_binary_host {
160 name: "sparse_img",
161 defaults: ["releasetools_binary_defaults"],
162 srcs: [
163 "rangelib.py",
164 "sparse_img.py",
165 ],
166 main: "sparse_img.py",
167}
168
Tao Baoca82fc92019-05-01 21:58:03 -0700169python_defaults {
170 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700171 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700172 "add_img_to_target_files.py",
173 "apex_utils.py",
174 "build_image.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700175 "check_ota_package_signature.py",
176 "check_target_files_signatures.py",
177 "edify_generator.py",
178 "img_from_target_files.py",
179 "make_recovery_patch.py",
180 "merge_target_files.py",
181 "ota_from_target_files.py",
182 "ota_package_parser.py",
183 "sign_apex.py",
184 "sign_target_files_apks.py",
185 "target_files_diff.py",
186 "validate_target_files.py",
187
Tao Bao30e31142019-04-09 00:12:30 -0700188 "test_*.py",
189 ],
190 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700191 "releasetools_build_super_image",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700192 "releasetools_common",
193 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700194 ],
195 data: [
196 "testdata/*",
197 ],
198 required: [
199 "otatools",
200 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700201}
202
203python_test_host {
204 name: "releasetools_test",
205 defaults: ["releasetools_test_defaults"],
206 main: "test_utils.py",
207 version: {
208 py2: {
209 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700210 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
211 // host, because the test executable won't be able to find the needed libs via its
212 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700213 embedded_launcher: false,
214 },
215 py3: {
216 enabled: false,
217 embedded_launcher: false,
218 },
219 },
220 test_suites: ["general-tests"],
221}
222
223python_test_host {
224 name: "releasetools_py3_test",
225 defaults: ["releasetools_test_defaults"],
226 main: "test_utils.py",
227 version: {
228 py2: {
229 enabled: false,
230 embedded_launcher: false,
231 },
232 py3: {
233 enabled: true,
234 embedded_launcher: false,
235 },
236 },
Tao Bao30e31142019-04-09 00:12:30 -0700237 test_suites: ["general-tests"],
238}