blob: f7f8a939f9c6cefc8063a1e5a810b32e1195b5d0 [file] [log] [blame]
Dan Willemsen4c939742016-12-06 15:44:57 -08001cc_defaults {
2 name: "installd_defaults",
3
4 cflags: [
5 "-Wall",
6 "-Werror",
Jeff Sharkeyc1149c92017-09-21 14:51:09 -06007 "-Wextra",
Andreas Gampefa2dadd2018-02-28 19:52:47 -08008
9 "-Wunreachable-code",
10 "-Wunreachable-code-break",
11 "-Wunreachable-code-return",
Dan Willemsen4c939742016-12-06 15:44:57 -080012 ],
13 srcs: [
Jeff Sharkey88ddd942017-01-17 18:05:54 -070014 "CacheItem.cpp",
15 "CacheTracker.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070016 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060017 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070018 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070019 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080020 "globals.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070021 "run_dex2oat.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080022 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010023 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080024 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080025 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080026 ],
Andreas Gampefa2dadd2018-02-28 19:52:47 -080027 header_libs: [
28 "dex2oat_headers",
29 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080030 shared_libs: [
31 "libbase",
32 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010033 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080034 "libcutils",
35 "liblog",
36 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070037 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080038 "libselinux",
39 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000040 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080041 ],
42
Risand57852c2018-11-02 04:51:14 +090043 product_variables: {
44 arc: {
45 exclude_srcs: [
46 "QuotaUtils.cpp",
47 ],
48 static_libs: [
49 "libarcdiskquota",
50 "arc_services_aidl",
51 ],
52 cflags: [
53 "-DUSE_ARC",
54 ],
55 },
56 },
57
Dan Willemsen4c939742016-12-06 15:44:57 -080058 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060059
60 tidy: true,
61 tidy_checks: [
62 "-*",
63 "clang-analyzer-security*",
64 "cert-*",
65 "-cert-err58-cpp",
66 ],
67 tidy_flags: [
68 "-warnings-as-errors=clang-analyzer-security*,cert-*"
69 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080070}
71
72//
73// Static library used in testing and executable
74//
75
76cc_library_static {
77 name: "libinstalld",
78 defaults: ["installd_defaults"],
79
80 export_include_dirs: ["."],
81 aidl: {
82 export_aidl_headers: true,
83 },
Risand57852c2018-11-02 04:51:14 +090084
85 product_variables: {
86 arc: {
87 exclude_srcs: [
88 "QuotaUtils.cpp",
89 ],
90 static_libs: [
91 "libarcdiskquota",
92 "arc_services_aidl",
93 ],
94 cflags: [
95 "-DUSE_ARC",
96 ],
97 },
98 },
99}
100
101cc_library_headers {
102 name: "libinstalld_headers",
103 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800104}
105
106//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700107// Unit tests
108//
109
110cc_test_host {
111 name: "run_dex2oat_test",
112 test_suites: ["general-tests"],
113 clang: true,
114 srcs: [
115 "run_dex2oat_test.cpp",
116 "run_dex2oat.cpp",
117 "execv_helper.cpp",
118 ],
119 cflags: ["-Wall", "-Werror"],
120 shared_libs: [
121 "libbase",
122 "server_configurable_flags",
123 ],
124 static_libs: [
125 //"libinstalld",
126 ],
127 test_config: "run_dex2oat_test.xml",
128}
129
130//
Dan Willemsen4c939742016-12-06 15:44:57 -0800131// Executable
132//
133
134cc_binary {
135 name: "installd",
136 defaults: ["installd_defaults"],
137 srcs: ["installd.cpp"],
138
139 static_libs: ["libdiskusage"],
140
141 init_rc: ["installd.rc"],
Risand57852c2018-11-02 04:51:14 +0900142
143 product_variables: {
144 arc: {
145 exclude_srcs: [
146 "QuotaUtils.cpp",
147 ],
148 static_libs: [
149 "libarcdiskquota",
150 "arc_services_aidl",
151 ],
152 cflags: [
153 "-DUSE_ARC",
154 ],
155 },
156 },
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100157
158 // Needs to be wherever installd is as it's execed by
159 // installd.
160 required: [ "migrate_legacy_obb_data.sh" ],
Dan Willemsen4c939742016-12-06 15:44:57 -0800161}
162
Dan Willemsen2a001e82016-08-05 14:06:41 -0700163// OTA chroot tool
164
165cc_binary {
166 name: "otapreopt_chroot",
Martijn Coenen8af07d92019-07-03 14:56:39 +0200167 defaults: ["libapexd-deps"],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700168 cflags: [
169 "-Wall",
170 "-Werror",
171 ],
172 clang: true,
173
Roland Levillain94b41802019-01-18 11:56:50 +0000174 srcs: [
175 "otapreopt_chroot.cpp",
176 "otapreopt_utils.cpp",
177 ],
Dan Willemsen2a001e82016-08-05 14:06:41 -0700178 shared_libs: [
179 "libbase",
180 "liblog",
Martijn Coenen13eba262019-03-13 12:59:57 +0100181 "libutils",
Roland Levillainc19c6042018-12-18 12:15:12 +0000182 ],
183 static_libs: [
Roland Levillainc19c6042018-12-18 12:15:12 +0000184 "libapexd",
Dan Willemsen2a001e82016-08-05 14:06:41 -0700185 ],
186}
Dan Willemsen4c939742016-12-06 15:44:57 -0800187
Colin Crossdd2dae92017-11-14 13:05:37 -0800188filegroup {
189 name: "installd_aidl",
190 srcs: [
191 "binder/android/os/IInstalld.aidl",
192 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700193 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800194}
195
Calin Juravledff47292018-02-01 14:44:56 +0000196//
197// Static library for otapreopt used in testing
198//
199cc_library_static {
200 name: "libotapreoptparameters",
201 cflags: [
202 "-Wall",
203 "-Werror"
204 ],
Calin Juravledff47292018-02-01 14:44:56 +0000205
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700206 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000207
208 export_include_dirs: ["."],
209
210 shared_libs: [
211 "libbase",
212 "libcutils",
213 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700214 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000215 "libutils",
216 ],
217}
218
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700219//
220// OTA Executable
221//
222
223cc_binary {
224 name: "otapreopt",
225 cflags: [
226 "-Wall",
227 "-Werror"
228 ],
229
230 srcs: [
231 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700232 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700233 "globals.cpp",
234 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000235 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700236 "run_dex2oat.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700237 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100238 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800239 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700240 ],
241
242 header_libs: ["dex2oat_headers"],
243
244 static_libs: [
245 "libartimagevalues",
246 "libdiskusage",
247 "libotapreoptparameters",
248 ],
249
250 shared_libs: [
251 "libbase",
252 "libcrypto",
253 "libcutils",
254 "liblog",
255 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700256 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700257 "libselinux",
258 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000259 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700260 ],
261}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800262
263// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800264sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800265 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800266 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800267 init_rc: ["otapreopt.rc"],
268}
269
270// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800271sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800272 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800273 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800274 // Let this depend on otapreopt, the chroot tool and the slot script,
275 // so we just have to mention one in a configuration.
276 required: [
277 "otapreopt",
278 "otapreopt_chroot",
279 "otapreopt_slot",
280 ],
281}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100282
283// Script to migrate legacy obb data.
284sh_binary {
285 name: "migrate_legacy_obb_data.sh",
286 src: "migrate_legacy_obb_data.sh"
287}