blob: 7085f510df467242d35e6a088c96c2f8cdf6a1ff [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",
Felka Chang2a0a2462019-11-20 14:20:40 +080016 "CrateManager.cpp",
Jeff Sharkeyf3e30b92016-12-09 17:06:57 -070017 "InstalldNativeService.cpp",
Risan5f308262018-10-26 12:06:58 -060018 "QuotaUtils.cpp",
Jeff Sharkey6c2c0562016-12-07 12:12:00 -070019 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070020 "execv_helper.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080021 "globals.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -070022 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -070023 "unique_file.cpp",
Dan Willemsen4c939742016-12-06 15:44:57 -080024 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +010025 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -080026 "view_compiler.cpp",
Colin Crossdd2dae92017-11-14 13:05:37 -080027 ":installd_aidl",
Dan Willemsen4c939742016-12-06 15:44:57 -080028 ],
29 shared_libs: [
30 "libbase",
31 "libbinder",
Alan Stokesa25d90c2017-10-16 10:56:00 +010032 "libcrypto",
Dan Willemsen4c939742016-12-06 15:44:57 -080033 "libcutils",
34 "liblog",
35 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -070036 "libprocessgroup",
Dan Willemsen4c939742016-12-06 15:44:57 -080037 "libselinux",
38 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +000039 "server_configurable_flags",
Dan Willemsen4c939742016-12-06 15:44:57 -080040 ],
Jooyung Handc413662021-02-04 18:18:28 +090041 export_shared_lib_headers: [
42 "libbinder",
43 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080044
Risand57852c2018-11-02 04:51:14 +090045 product_variables: {
46 arc: {
47 exclude_srcs: [
48 "QuotaUtils.cpp",
49 ],
50 static_libs: [
51 "libarcdiskquota",
52 "arc_services_aidl",
53 ],
54 cflags: [
55 "-DUSE_ARC",
56 ],
57 },
58 },
59
Dan Willemsen4c939742016-12-06 15:44:57 -080060 clang: true,
Jeff Sharkeyc1149c92017-09-21 14:51:09 -060061
62 tidy: true,
63 tidy_checks: [
64 "-*",
65 "clang-analyzer-security*",
66 "cert-*",
67 "-cert-err58-cpp",
68 ],
69 tidy_flags: [
70 "-warnings-as-errors=clang-analyzer-security*,cert-*"
71 ],
Dan Willemsen4c939742016-12-06 15:44:57 -080072}
73
74//
75// Static library used in testing and executable
76//
77
78cc_library_static {
79 name: "libinstalld",
80 defaults: ["installd_defaults"],
81
82 export_include_dirs: ["."],
83 aidl: {
84 export_aidl_headers: true,
85 },
Risand57852c2018-11-02 04:51:14 +090086
87 product_variables: {
88 arc: {
89 exclude_srcs: [
90 "QuotaUtils.cpp",
91 ],
92 static_libs: [
93 "libarcdiskquota",
94 "arc_services_aidl",
95 ],
96 cflags: [
97 "-DUSE_ARC",
98 ],
99 },
100 },
101}
102
103cc_library_headers {
104 name: "libinstalld_headers",
105 export_include_dirs: ["."],
Dan Willemsen4c939742016-12-06 15:44:57 -0800106}
107
108//
Victor Hsiehc9821f12020-08-07 11:32:29 -0700109// Unit tests
110//
111
112cc_test_host {
113 name: "run_dex2oat_test",
114 test_suites: ["general-tests"],
115 clang: true,
116 srcs: [
117 "run_dex2oat_test.cpp",
118 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700119 "unique_file.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700120 "execv_helper.cpp",
121 ],
122 cflags: ["-Wall", "-Werror"],
123 shared_libs: [
124 "libbase",
125 "server_configurable_flags",
126 ],
Victor Hsiehc9821f12020-08-07 11:32:29 -0700127 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",
Felka Chang2a0a2462019-11-20 14:20:40 +0800192 "binder/android/os/storage/CrateMetadata.aidl",
Colin Crossdd2dae92017-11-14 13:05:37 -0800193 ],
Dan Willemsena5d65222018-09-14 21:27:01 -0700194 path: "binder",
Colin Crossdd2dae92017-11-14 13:05:37 -0800195}
196
Calin Juravledff47292018-02-01 14:44:56 +0000197//
198// Static library for otapreopt used in testing
199//
200cc_library_static {
201 name: "libotapreoptparameters",
202 cflags: [
203 "-Wall",
204 "-Werror"
205 ],
Calin Juravledff47292018-02-01 14:44:56 +0000206
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700207 srcs: ["otapreopt_parameters.cpp"],
Calin Juravledff47292018-02-01 14:44:56 +0000208
209 export_include_dirs: ["."],
210
211 shared_libs: [
212 "libbase",
213 "libcutils",
214 "liblog",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700215 "libprocessgroup",
Calin Juravledff47292018-02-01 14:44:56 +0000216 "libutils",
217 ],
218}
219
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700220//
221// OTA Executable
222//
223
224cc_binary {
225 name: "otapreopt",
226 cflags: [
227 "-Wall",
228 "-Werror"
229 ],
230
231 srcs: [
232 "dexopt.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700233 "execv_helper.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700234 "globals.cpp",
235 "otapreopt.cpp",
Roland Levillain94b41802019-01-18 11:56:50 +0000236 "otapreopt_utils.cpp",
Victor Hsiehc9821f12020-08-07 11:32:29 -0700237 "run_dex2oat.cpp",
Victor Hsiehcb35a062020-08-13 16:11:13 -0700238 "unique_file.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700239 "utils.cpp",
Oleksandr Peletskyid2be6322019-01-24 17:59:45 +0100240 "utils_default.cpp",
Eric Holk0ebbe0f2019-01-09 18:17:27 -0800241 "view_compiler.cpp",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700242 ],
243
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700244 static_libs: [
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700245 "libdiskusage",
246 "libotapreoptparameters",
247 ],
248
249 shared_libs: [
250 "libbase",
251 "libcrypto",
252 "libcutils",
253 "liblog",
254 "liblogwrap",
Suren Baghdasaryancd829052018-11-02 19:15:37 -0700255 "libprocessgroup",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700256 "libselinux",
257 "libutils",
Nicolas Geoffrayaaad21e2019-02-25 13:31:10 +0000258 "server_configurable_flags",
Andreas Gampece9fe7f2018-09-18 10:25:58 -0700259 ],
260}
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800261
262// OTA slot script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800263sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800264 name: "otapreopt_slot",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800265 src: "otapreopt_slot.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800266 init_rc: ["otapreopt.rc"],
267}
268
269// OTA postinstall script
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800270sh_binary {
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800271 name: "otapreopt_script",
Sasha Smundak1fa4b8d2019-02-04 11:20:58 -0800272 src: "otapreopt_script.sh",
Sasha Smundak6a6bdad2019-01-24 23:20:47 -0800273 // Let this depend on otapreopt, the chroot tool and the slot script,
274 // so we just have to mention one in a configuration.
275 required: [
276 "otapreopt",
277 "otapreopt_chroot",
278 "otapreopt_slot",
279 ],
280}
Narayan Kamath28ab93b2019-05-15 18:29:44 +0100281
282// Script to migrate legacy obb data.
283sh_binary {
284 name: "migrate_legacy_obb_data.sh",
285 src: "migrate_legacy_obb_data.sh"
286}