blob: 0e2f3de156f33c62c8307ee207716bcd3ea44513 [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 {
118 name: "merge_builds",
119 defaults: ["releasetools_binary_defaults"],
120 srcs: [
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700121 "merge_builds.py",
122 ],
123 main: "merge_builds.py",
124 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700125 "releasetools_build_super_image",
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700126 "releasetools_common",
127 ],
128}
129
Tao Bao8821d642019-08-05 12:05:45 -0700130python_binary_host {
131 name: "ota_from_target_files",
132 defaults: ["releasetools_binary_defaults"],
133 srcs: [
134 "edify_generator.py",
135 "ota_from_target_files.py",
136 ],
137 libs: [
138 "releasetools_common",
139 "releasetools_verity_utils",
140 ],
141 required: [
142 "brillo_update_payload",
143 ],
144}
145
Tao Baoca82fc92019-05-01 21:58:03 -0700146python_defaults {
147 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700148 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700149 "add_img_to_target_files.py",
150 "apex_utils.py",
151 "build_image.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700152 "check_ota_package_signature.py",
153 "check_target_files_signatures.py",
154 "edify_generator.py",
155 "img_from_target_files.py",
156 "make_recovery_patch.py",
157 "merge_target_files.py",
158 "ota_from_target_files.py",
159 "ota_package_parser.py",
160 "sign_apex.py",
161 "sign_target_files_apks.py",
162 "target_files_diff.py",
163 "validate_target_files.py",
164
Tao Bao30e31142019-04-09 00:12:30 -0700165 "test_*.py",
166 ],
167 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700168 "releasetools_build_super_image",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700169 "releasetools_common",
170 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700171 ],
172 data: [
173 "testdata/*",
174 ],
175 required: [
176 "otatools",
177 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700178}
179
180python_test_host {
181 name: "releasetools_test",
182 defaults: ["releasetools_test_defaults"],
183 main: "test_utils.py",
184 version: {
185 py2: {
186 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700187 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
188 // host, because the test executable won't be able to find the needed libs via its
189 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700190 embedded_launcher: false,
191 },
192 py3: {
193 enabled: false,
194 embedded_launcher: false,
195 },
196 },
197 test_suites: ["general-tests"],
198}
199
200python_test_host {
201 name: "releasetools_py3_test",
202 defaults: ["releasetools_test_defaults"],
203 main: "test_utils.py",
204 version: {
205 py2: {
206 enabled: false,
207 embedded_launcher: false,
208 },
209 py3: {
210 enabled: true,
211 embedded_launcher: false,
212 },
213 },
Tao Bao30e31142019-04-09 00:12:30 -0700214 test_suites: ["general-tests"],
215}