blob: d4c46732c7a2693b806d86821c0a46cc1a8f80f7 [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
Tao Baoca82fc92019-05-01 21:58:03 -0700109python_defaults {
110 name: "releasetools_test_defaults",
Tao Bao30e31142019-04-09 00:12:30 -0700111 srcs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700112 "add_img_to_target_files.py",
113 "apex_utils.py",
114 "build_image.py",
115 "build_super_image.py",
116 "check_ota_package_signature.py",
117 "check_target_files_signatures.py",
118 "edify_generator.py",
119 "img_from_target_files.py",
120 "make_recovery_patch.py",
121 "merge_target_files.py",
122 "ota_from_target_files.py",
123 "ota_package_parser.py",
124 "sign_apex.py",
125 "sign_target_files_apks.py",
126 "target_files_diff.py",
127 "validate_target_files.py",
128
Tao Bao30e31142019-04-09 00:12:30 -0700129 "test_*.py",
130 ],
131 libs: [
Tao Bao2bbb07c2019-05-07 13:12:21 -0700132 "releasetools_common",
133 "releasetools_verity_utils",
Tao Bao30e31142019-04-09 00:12:30 -0700134 ],
135 data: [
136 "testdata/*",
137 ],
138 required: [
139 "otatools",
140 ],
Tao Baoca82fc92019-05-01 21:58:03 -0700141}
142
143python_test_host {
144 name: "releasetools_test",
145 defaults: ["releasetools_test_defaults"],
146 main: "test_utils.py",
147 version: {
148 py2: {
149 enabled: true,
Tao Bao2bbb07c2019-05-07 13:12:21 -0700150 // When using embedded launcher, atest will try (but may fail) to load libc++.so from
151 // host, because the test executable won't be able to find the needed libs via its
152 // runpath.
Tao Baoca82fc92019-05-01 21:58:03 -0700153 embedded_launcher: false,
154 },
155 py3: {
156 enabled: false,
157 embedded_launcher: false,
158 },
159 },
160 test_suites: ["general-tests"],
161}
162
163python_test_host {
164 name: "releasetools_py3_test",
165 defaults: ["releasetools_test_defaults"],
166 main: "test_utils.py",
167 version: {
168 py2: {
169 enabled: false,
170 embedded_launcher: false,
171 },
172 py3: {
173 enabled: true,
174 embedded_launcher: false,
175 },
176 },
Tao Bao30e31142019-04-09 00:12:30 -0700177 test_suites: ["general-tests"],
178}