blob: 40cdce8b99176e0eca2e0ef5bee45b5abfb2575b [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 Baoca82fc92019-05-01 21:58:03 -0700122python_defaults {
123 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700124 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700125 "add_img_to_target_files.py",
126 "apex_utils.py",
127 "build_image.py",
128 "build_super_image.py",
129 "check_ota_package_signature.py",
130 "check_target_files_signatures.py",
131 "edify_generator.py",
132 "img_from_target_files.py",
133 "make_recovery_patch.py",
134 "merge_target_files.py",
135 "ota_from_target_files.py",
136 "ota_package_parser.py",
137 "sign_apex.py",
138 "sign_target_files_apks.py",
139 "target_files_diff.py",
140 "validate_target_files.py",
141
Tao Bao30e31142019-04-09 00:12:30 -0700142 "test_*.py",
143 ],
144 libs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700145 "releasetools_common",
146 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700147 ],
148 data: [
149 "testdata/*",
150 ],
151 required: [
152 "otatools",
153 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700154}
155
156python_test_host {
157 name: "releasetools_test",
158 defaults: ["releasetools_test_defaults"],
159 main: "test_utils.py",
160 version: {
161 py2: {
162 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700163 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
164 // host, because the test executable won't be able to find the needed libs via its
165 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700166 embedded_launcher: false,
167 },
168 py3: {
169 enabled: false,
170 embedded_launcher: false,
171 },
172 },
173 test_suites: ["general-tests"],
174}
175
176python_test_host {
177 name: "releasetools_py3_test",
178 defaults: ["releasetools_test_defaults"],
179 main: "test_utils.py",
180 version: {
181 py2: {
182 enabled: false,
183 embedded_launcher: false,
184 },
185 py3: {
186 enabled: true,
187 embedded_launcher: false,
188 },
189 },
Tao Bao30e31142019-04-09 00:12:30 -0700190 test_suites: ["general-tests"],
191}