blob: c62e7d8f651263d053b820f439b95becb4e8907a [file] [log] [blame]
Yi-Yo Chianga37920c2022-01-18 23:50:43 +08001// Copyright (C) 2022 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
Bob Badour302cb502022-01-27 10:48:59 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Bowgo Tsai34ac1ae2022-02-26 23:26:34 +080019python_test_host {
20 name: "certify_bootimg_test",
21 defaults: ["mkbootimg_defaults"],
22 main: "certify_bootimg_test.py",
23 srcs: [
24 "certify_bootimg_test.py",
25 ],
26 data: [
27 ":avbtool",
28 ":certify_bootimg",
29 ":mkbootimg",
30 ":unpack_bootimg",
31 "testdata/*",
32 ],
33 test_options: {
34 unit_test: true,
35 },
36}
37
38python_binary_host {
Yi-Yo Chianga37920c2022-01-18 23:50:43 +080039 name: "generate_gki_certificate",
40 defaults: ["mkbootimg_defaults"],
41 srcs: [
42 "generate_gki_certificate.py",
43 ],
44 required: [
45 "avbtool",
46 ],
47}
48
49sh_binary_host {
50 name: "retrofit_gki",
51 src: "retrofit_gki.sh",
52 required: [
Yi-Yo Chiang3e4ce832022-02-22 18:32:19 +080053 "avbtool",
Yi-Yo Chianga37920c2022-01-18 23:50:43 +080054 "mkbootimg",
55 "unpack_bootimg",
56 ],
57}
58
59sh_test_host {
60 name: "retrofit_gki_test",
61 src: "retrofit_gki_test.sh",
62 data: [
63 "retrofit_gki.sh",
64 ],
65 data_bins: [
Yi-Yo Chiang3e4ce832022-02-22 18:32:19 +080066 "avbtool",
Yi-Yo Chianga37920c2022-01-18 23:50:43 +080067 "mkbootimg",
68 "unpack_bootimg",
69 ],
70 test_suites: [
71 "general-tests",
72 ],
73}
Yi-Yo Chiang680c62a2022-01-23 00:26:11 +080074
75genrule {
76 name: "gki_retrofitting_tools",
77 tools: [
78 "soong_zip",
79 "retrofit_gki",
Yi-Yo Chiang3e4ce832022-02-22 18:32:19 +080080 "avbtool",
Yi-Yo Chiang680c62a2022-01-23 00:26:11 +080081 "mkbootimg",
82 "unpack_bootimg",
83 ],
84 srcs: [
85 "README.md",
86 ],
87 cmd: "STAGE_DIR=$(genDir)/gki_retrofitting_tools && " +
88 "rm -rf $${STAGE_DIR} && mkdir -p $${STAGE_DIR} && " +
89 "cp $(location retrofit_gki) $${STAGE_DIR} && " +
Yi-Yo Chiang3e4ce832022-02-22 18:32:19 +080090 "cp $(location avbtool) $${STAGE_DIR} && " +
Yi-Yo Chiang680c62a2022-01-23 00:26:11 +080091 "cp $(location mkbootimg) $${STAGE_DIR} && " +
92 "cp $(location unpack_bootimg) $${STAGE_DIR} && " +
93 "cp $(in) $${STAGE_DIR} && " +
94 "$(location soong_zip) -o $(out) -C $(genDir) -D $${STAGE_DIR}",
95 out: [
96 "gki_retrofitting_tools.zip",
97 ],
98 dist: {
99 targets: [
100 "gki_retrofitting_tools",
101 ],
102 },
103}