blob: 80c233b89b60cac2c594968cb321581a1d075b79 [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",
147 ],
148 libs: [
149 "releasetools_common",
150 "releasetools_verity_utils",
151 ],
152 required: [
153 "brillo_update_payload",
154 ],
155}
156
Tao Baoe11a4602019-08-06 23:21:23 -0700157python_binary_host {
158 name: "sparse_img",
159 defaults: ["releasetools_binary_defaults"],
160 srcs: [
161 "rangelib.py",
162 "sparse_img.py",
163 ],
164 main: "sparse_img.py",
165}
166
Tao Baoca82fc92019-05-01 21:58:03 -0700167python_defaults {
168 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700169 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700170 "add_img_to_target_files.py",
171 "apex_utils.py",
172 "build_image.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700173 "check_ota_package_signature.py",
174 "check_target_files_signatures.py",
175 "edify_generator.py",
176 "img_from_target_files.py",
177 "make_recovery_patch.py",
178 "merge_target_files.py",
179 "ota_from_target_files.py",
180 "ota_package_parser.py",
181 "sign_apex.py",
182 "sign_target_files_apks.py",
183 "target_files_diff.py",
184 "validate_target_files.py",
185
Tao Bao30e31142019-04-09 00:12:30 -0700186 "test_*.py",
187 ],
188 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700189 "releasetools_build_super_image",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700190 "releasetools_common",
191 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700192 ],
193 data: [
194 "testdata/*",
195 ],
196 required: [
197 "otatools",
198 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700199}
200
201python_test_host {
202 name: "releasetools_test",
203 defaults: ["releasetools_test_defaults"],
204 main: "test_utils.py",
205 version: {
206 py2: {
207 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700208 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
209 // host, because the test executable won't be able to find the needed libs via its
210 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700211 embedded_launcher: false,
212 },
213 py3: {
214 enabled: false,
215 embedded_launcher: false,
216 },
217 },
218 test_suites: ["general-tests"],
219}
220
221python_test_host {
222 name: "releasetools_py3_test",
223 defaults: ["releasetools_test_defaults"],
224 main: "test_utils.py",
225 version: {
226 py2: {
227 enabled: false,
228 embedded_launcher: false,
229 },
230 py3: {
231 enabled: true,
232 embedded_launcher: false,
233 },
234 },
Tao Bao30e31142019-04-09 00:12:30 -0700235 test_suites: ["general-tests"],
236}