blob: 322bb58f282b5bb9a21d83c1475a58b6c0d56dfc [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 Baoca82fc92019-05-01 21:58:03 -0700130python_defaults {
131 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700132 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700133 "add_img_to_target_files.py",
134 "apex_utils.py",
135 "build_image.py",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700136 "check_ota_package_signature.py",
137 "check_target_files_signatures.py",
138 "edify_generator.py",
139 "img_from_target_files.py",
140 "make_recovery_patch.py",
141 "merge_target_files.py",
142 "ota_from_target_files.py",
143 "ota_package_parser.py",
144 "sign_apex.py",
145 "sign_target_files_apks.py",
146 "target_files_diff.py",
147 "validate_target_files.py",
148
Tao Bao30e31142019-04-09 00:12:30 -0700149 "test_*.py",
150 ],
151 libs: [
Tao Bao005305a2019-08-05 13:00:44 -0700152 "releasetools_build_super_image",
Tao Bao2bbb07c2019-05-07 13:12:21 -0700153 "releasetools_common",
154 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700155 ],
156 data: [
157 "testdata/*",
158 ],
159 required: [
160 "otatools",
161 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700162}
163
164python_test_host {
165 name: "releasetools_test",
166 defaults: ["releasetools_test_defaults"],
167 main: "test_utils.py",
168 version: {
169 py2: {
170 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700171 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
172 // host, because the test executable won't be able to find the needed libs via its
173 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700174 embedded_launcher: false,
175 },
176 py3: {
177 enabled: false,
178 embedded_launcher: false,
179 },
180 },
181 test_suites: ["general-tests"],
182}
183
184python_test_host {
185 name: "releasetools_py3_test",
186 defaults: ["releasetools_test_defaults"],
187 main: "test_utils.py",
188 version: {
189 py2: {
190 enabled: false,
191 embedded_launcher: false,
192 },
193 py3: {
194 enabled: true,
195 embedded_launcher: false,
196 },
197 },
Tao Bao30e31142019-04-09 00:12:30 -0700198 test_suites: ["general-tests"],
199}