blob: 34e75c02821eeb11d1c2659c9841a2fdf84c06d3 [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 Bao2bbb07c2019-05-07 13:12:21 -070028 name: "releasetools_common",
29 defaults: ["releasetools_library_defaults"],
Tao Bao30e31142019-04-09 00:12:30 -070030 srcs: [
Tao Bao30e31142019-04-09 00:12:30 -070031 "blockimgdiff.py",
Tao Bao30e31142019-04-09 00:12:30 -070032 "common.py",
Tianjie Xu41976c72019-07-03 13:57:01 -070033 "images.py",
Tao Bao30e31142019-04-09 00:12:30 -070034 "rangelib.py",
Tao Bao30e31142019-04-09 00:12:30 -070035 "sparse_img.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -070036 ],
37 // Only the tools that are referenced directly are listed as required modules. For example,
38 // `avbtool` is not here, as the script always uses the one from info_dict['avb_avbtool'].
39 required: [
40 "aapt",
41 "boot_signer",
42 "brotli",
43 "bsdiff",
44 "imgdiff",
45 "minigzip",
46 "mkbootfs",
47 ],
48}
49
50python_library_host {
51 name: "releasetools_verity_utils",
52 defaults: ["releasetools_library_defaults"],
53 srcs: [
Tao Bao30e31142019-04-09 00:12:30 -070054 "verity_utils.py",
55 ],
Tao Bao2bbb07c2019-05-07 13:12:21 -070056 required: [
57 "append2simg",
58 "build_verity_metadata",
59 "build_verity_tree",
60 "fec",
61 ],
62}
63
64python_defaults {
65 name: "releasetools_binary_defaults",
66 version: {
67 py2: {
68 enabled: true,
69 embedded_launcher: true,
70 },
71 py3: {
72 enabled: false,
73 embedded_launcher: false,
74 },
75 },
76}
77
78python_binary_host {
79 name: "build_image",
80 defaults: ["releasetools_binary_defaults"],
81 srcs: [
82 "build_image.py",
83 ],
84 main: "build_image.py",
85 libs: [
86 "releasetools_common",
87 "releasetools_verity_utils",
88 ],
89 required: [
90 "blk_alloc_to_base_fs",
91 "e2fsck",
92 "simg2img",
93 "tune2fs",
94 ],
95}
96
97python_binary_host {
98 name: "build_super_image",
99 defaults: ["releasetools_binary_defaults"],
100 srcs: [
101 "build_super_image.py",
102 ],
103 main: "build_super_image.py",
104 libs: [
105 "releasetools_common",
106 ],
Tao Bao30e31142019-04-09 00:12:30 -0700107}
108
Daniel Normanbfc51ef2019-07-24 14:34:54 -0700109python_binary_host {
110 name: "merge_builds",
111 defaults: ["releasetools_binary_defaults"],
112 srcs: [
113 "build_super_image.py",
114 "merge_builds.py",
115 ],
116 main: "merge_builds.py",
117 libs: [
118 "releasetools_common",
119 ],
120}
121
Tao Bao8821d642019-08-05 12:05:45 -0700122python_binary_host {
123 name: "ota_from_target_files",
124 defaults: ["releasetools_binary_defaults"],
125 srcs: [
126 "edify_generator.py",
127 "ota_from_target_files.py",
128 ],
129 libs: [
130 "releasetools_common",
131 "releasetools_verity_utils",
132 ],
133 required: [
134 "brillo_update_payload",
135 ],
136}
137
Tao Baoca82fc92019-05-01 21:58:03 -0700138python_defaults {
139 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700140 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700141 "add_img_to_target_files.py",
142 "apex_utils.py",
143 "build_image.py",
144 "build_super_image.py",
145 "check_ota_package_signature.py",
146 "check_target_files_signatures.py",
147 "edify_generator.py",
148 "img_from_target_files.py",
149 "make_recovery_patch.py",
150 "merge_target_files.py",
151 "ota_from_target_files.py",
152 "ota_package_parser.py",
153 "sign_apex.py",
154 "sign_target_files_apks.py",
155 "target_files_diff.py",
156 "validate_target_files.py",
157
Tao Bao30e31142019-04-09 00:12:30 -0700158 "test_*.py",
159 ],
160 libs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700161 "releasetools_common",
162 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700163 ],
164 data: [
165 "testdata/*",
166 ],
167 required: [
168 "otatools",
169 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700170}
171
172python_test_host {
173 name: "releasetools_test",
174 defaults: ["releasetools_test_defaults"],
175 main: "test_utils.py",
176 version: {
177 py2: {
178 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700179 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
180 // host, because the test executable won't be able to find the needed libs via its
181 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700182 embedded_launcher: false,
183 },
184 py3: {
185 enabled: false,
186 embedded_launcher: false,
187 },
188 },
189 test_suites: ["general-tests"],
190}
191
192python_test_host {
193 name: "releasetools_py3_test",
194 defaults: ["releasetools_test_defaults"],
195 main: "test_utils.py",
196 version: {
197 py2: {
198 enabled: false,
199 embedded_launcher: false,
200 },
201 py3: {
202 enabled: true,
203 embedded_launcher: false,
204 },
205 },
Tao Bao30e31142019-04-09 00:12:30 -0700206 test_suites: ["general-tests"],
207}